How to use ldap authentication with dovecot

 

Step-1  

[root @server~]#   vim   /etc/dovecot/conf.d/10-auth.conf  

( Uncomment Following line )

  !include auth-ldap.conf.ext

 

Step-2

[root @server~]#   vim     /etc/dovecot/conf.d/auth-ldap.conf.ext

passdb {

  driver = ldap
  args = /etc/dovecot/dovecot-ldap.conf.ext
}
 
userdb {
  driver = ldap
  args = /etc/dovecot/dovecot-ldap.conf.ext
}

 

Step-3

[root @server~]#   vim   /etc/dovecot/dovecot-ldap.conf.ext 

hosts = server.leolinux.in

dn= "cn=Manager,dc=leolinux,dc=in

dnpass = "redhat"

tls = yes

tls_ca_cert_file = /etc/dovecot/cacert.pem

auth_bind = yes

ldap_version = 3

base = dc=leolinux,dc=in

user_attrs = homeDirectory=home,uidNumber=uid,gidNumber=gid

user_filter = (uid=%u)

pass_attrs = uid=user,userPassword=password

pass_filter = (uid=%u)

 

Step-4 

[root @server~]#   service  dovecot   restart