It worked, this works with roundcube as installed by iRed.
The only thing now is to get SOGO to authenticate I have yet to figure that out. any hints would be appreciated.
This allow me to add users via ired admin or on the AD server. This way I dont needto buy Micro$oft licenses for each user that need no AD account.
here is the configuration,
/etc/dovecot/dovecot.conf
# Virtual mail accounts.
userdb {
args = /etc/dovecot/dovecot-ldap.conf
driver = ldap
skip = never
result_failure = continue
result_internalfail = continue
result_success = return-ok
}
passdb {
args = /etc/dovecot/dovecot-ldap.conf
driver = ldap
}
#
userdb {
args = /etc/dovecot/dovecot-ldap-ired.conf
driver = ldap
}
passdb {
args = /etc/dovecot/dovecot-ldap-ired.conf
driver = ldap
}
------------------------------------------------
dovecot-ldap.conf
hosts = AD.servername.domain.com:389
ldap_version = 3
auth_bind = yes
dn = vmail
dnpass = AD server password
base = cn=users,dc=domain,dc=com
scope = subtree
deref = never
user_filter = (&(objectCategory=person)(objectClass=user)(mail=%u))
pass_filter = (&(objectCategory=person)(objectClass=user)(mail=%u)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
pass_attrs = userPassword=password
user_attrs = =home=/var/vmail/vmail1/%Ld/%Ln/,=mail=maildir:/var/vmail/vmail1/%Ld/%Ln/
default_pass_scheme = MD5
-------------------------------------------------
dovecot-ldap-ired.conf
#This is the original file created by ired install with few changes for my local config
hosts = 127.0.0.1:389
ldap_version = 3
auth_bind = yes
dn = cn=vmail,dc=domain,dc=com
dnpass = ired-ldap-password
base = o=domains,dc=domain,dc=com
scope = subtree
deref = never
# Below two are required by command 'doveadm mailbox ...'
iterate_attrs = mail=user
iterate_filter = (&(objectClass=mailUser)(accountStatus=active)(enabledService=mail))
user_filter = (&(objectClass=mailUser)(accountStatus=active)(enabledService=mail)(enabledService=%Ls%Lc)(|(mail=%u)(&(enabledService=shadowaddress)(shadowAddress=%u))))
##user_attrs = mail=user,homeDirectory=home,=mail=maildir:~/Maildir/,mailQuota=quota_rule=*:bytes=%$
user_attrs = =home=/var/vmail/vmail1/%Ld/%Ln/,=mail=maildir:/var/vmail/vmail1/%Ld/%Ln/,mailQuota=quota_rule=*:bytes=%$
pass_filter = (&(objectClass=mailUser)(accountStatus=active)(enabledService=mail)(enabledService=%Ls%Lc)(|(mail=%u)(&(enabledService=shadowaddress)(shadowAddress=%u))))
pass_attrs = mail=user,userPassword=password
default_pass_scheme = CRYPT
--------------------------------------------------------