Dovecot Active Directory Authentication: Difference between revisions

From QmailToaster
Jump to navigation Jump to search
(Created page with "Back<br> Assumes working AD server # cd /etc/dovecot # cat > dovecot-ldap.conf.ext << __EOF__ hosts = mail.domain.tld dn = administrator@domain.tld dnpass = "adminpass" base = cn=users,dc=domain,dc=tld ldap_version = 3 auth_bind = yes iterate_attrs = userPrincipalName=user iterate_filter = (&(userPrincipalName=*)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2))) user_filter = (&(userPrin...")
 
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 5: Line 5:
  # cd /etc/dovecot
  # cd /etc/dovecot
  # cat >  dovecot-ldap.conf.ext << __EOF__
  # cat >  dovecot-ldap.conf.ext << __EOF__
  hosts = mail.domain.tld
  hosts = ad.domain.tld
dn = administrator@domain.tld
dnpass = "adminpass"
base = cn=users,dc=domain,dc=tld
  ldap_version = 3
  ldap_version = 3
base = dc=domain,dc=tld
auth_bind_userdn = %u
  auth_bind = yes
  auth_bind = yes
iterate_attrs  = userPrincipalName=user
iterate_filter  = (&(userPrincipalName=*)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
user_filter    = (&(userPrincipalName=%u)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
pass_filter    = (&(userPrincipalName=%u)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
pass_attrs      = userPassword=password
default_pass_scheme = CRYPT
  __EOF__
  __EOF__


Add to /etc/dovecot.conf while commenting any other passdb and userdb settings
Change passdb; userdb untouched
  mail_location = maildir:~/Maildir/
  # Authenticates by AD server
  passdb {
  passdb {
   driver = ldap
   driver = ldap
   args = /etc/dovecot/dovecot-ldap.conf.ext
   args = /etc/dovecot/dovecot-ldap.conf.ext
  }
  }
# Retrieves user home directory, mail directory, uid, and gid
  userdb {
  userdb {
   driver = static
   driver = sql
   args = uid=89 gid=89 home=/home/vpopmail/domains/%d/%n
   args = /etc/dovecot/dovecot-sql.conf.ext
  }
  }
 
  # systemctl restart dovecot
  # systemctl restart dovecot


[[Qmail_Dovecot_Authentication|Configure QMT Dovecot authorization]]
[[Qmail_Dovecot_Authentication|Configure QMT Dovecot authorization]]

Latest revision as of 16:43, 26 January 2025

Back

Assumes working AD server

# cd /etc/dovecot
# cat >  dovecot-ldap.conf.ext << __EOF__
hosts = ad.domain.tld
ldap_version = 3
base = dc=domain,dc=tld
auth_bind_userdn = %u
auth_bind = yes
__EOF__

Change passdb; userdb untouched

# Authenticates by AD server
passdb {
  driver = ldap
  args = /etc/dovecot/dovecot-ldap.conf.ext
}
# Retrieves user home directory, mail directory, uid, and gid 
userdb {
  driver = sql
  args = /etc/dovecot/dovecot-sql.conf.ext
}

# systemctl restart dovecot

Configure QMT Dovecot authorization