[Dovecot] LDAP authentication
Hi guys im new to dovecot , and im trying to authenticate dovecot to LDAP
this my configuration
dovecot --version
1.2.15
dovecot -n
# 1.2.15: /etc/dovecot/dovecot.conf # OS: Linux 2.6.32-5-amd64 x86_64 Debian 6.0.5 log_timestamp: %Y-%m-%d %H:%M:%S protocols: imap pop3 login_dir: /var/run/dovecot/login login_executable(default): /usr/lib/dovecot/imap-login login_executable(imap): /usr/lib/dovecot/imap-login login_executable(pop3): /usr/lib/dovecot/pop3-login mail_privileged_group: mail mail_location: mbox:~/mail:INBOX=/var/mail/%u mbox_write_locks: fcntl dotlock mail_executable(default): /usr/lib/dovecot/imap mail_executable(imap): /usr/lib/dovecot/imap mail_executable(pop3): /usr/lib/dovecot/pop3 mail_plugin_dir(default): /usr/lib/dovecot/modules/imap mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3 auth default: verbose: yes debug: yes passdb: driver: pam passdb: driver: ldap args: /etc/dovecot/dovecot-ldap.conf userdb: driver: passwd userdb: driver: ldap args: /etc/dovecot/dovecot-ldap.conf
*Out put of dovecot-ldap.conf* file
uris = ldap://ldap.example.com:389 dn = cn=admin,dc=example,dc=com dnpass = abc tls = no ldap_version = 3 base = ou=users,dc=example,dc=com scope = subtree user_attrs = homeDirectory=home,uidNumber=uid,gidNumber=gid user_filter = (&(objectClass=inetOrgPerson)(uid=%u)) pass_attrs = uid=user,userPassword=password pass_filter = (&(objectClass=inetOrgPerson)(uid=%u))
- *Out put of LDAP , *
Entry 1: uid=userone,ou=users,dc=example,dc=com
dn: uid=userone,ou=users,dc=example,dc=com cn: Firtname Lastname displayname: Firtname Lastname givenname: Firstname mail: userone@example.com objectclass: inetOrgPerson objectclass: top sn: Lastname uid: userone userpassword: {SHA}0P/ssspVCIZx8+tVsss=
but authentication fails with the follwing error , Please Advice
Apr 19 08:18:48 localhost dovecot: auth(default): client in: AUTH#0111#011PLAIN#011service=imap#011secured#011lip=127.0.0.1#011rip=127.0.0.1#011lport=143#011rport=38734#011resp=<hidden> Apr 19 08:18:48 localhost dovecot: auth-worker(default): pam(userone,127.0.0.1): lookup service=dovecot Apr 19 08:18:48 localhost dovecot: auth-worker(default): pam(userone,127.0.0.1): #1/1 style=1 msg=Password: Apr 19 08:18:49 localhost dovecot: auth(default): new auth connection: pid=7517 Apr 19 08:18:50 localhost dovecot: auth-worker(default): pam(userone,127.0.0.1): pam_authenticate() failed: Authentication failure (password mismatch?) Apr 19 08:18:50 localhost dovecot: auth(default): ldap(userone,127.0.0.1): pass search: base=ou=users,dc=example,dc=com scope=subtree filter=(uid=userone) fields=uid,userPassword Apr 19 08:18:50 localhost dovecot: auth(default): ldap(userone,127.0.0.1): result: uid(user)=userone userPassword(password)=<hidden> Apr 19 08:18:50 localhost dovecot: auth(default): client out: OK#0111#011user=userone Apr 19 08:18:50 localhost dovecot: auth(default): master in: REQUEST#0111#0117514#0111 Apr 19 08:18:50 localhost dovecot: auth(default): passwd(userone,127.0.0.1): lookup Apr 19 08:18:50 localhost dovecot: auth(default): passwd(userone,127.0.0.1): unknown user Apr 19 08:18:50 localhost dovecot: auth(default): ldap(userone,127.0.0.1): user search: base=ou=users,dc=example,dc=com scope=subtree filter=(uid=userone) fields=homeDirectory,uidNumber,gidNumber Apr 19 08:18:51 localhost dovecot: auth(default): ldap(userone,127.0.0.1): no fields returned by the server Apr 19 08:18:51 localhost dovecot: auth(default): master out: USER#0111#011userone Apr 19 08:18:51 localhost dovecot: dovecot: User userone is missing UID (see mail_uid setting) Apr 19 08:18:51 localhost dovecot: imap-login: Internal login failure (auth failed, 1 attempts): user=<userone>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Fri, 19 Apr 2013, val john wrote:
uris = ldap://ldap.example.com:389 dn = cn=admin,dc=example,dc=com dnpass = abc tls = no ldap_version = 3 base = ou=users,dc=example,dc=com scope = subtree user_attrs = homeDirectory=home,uidNumber=uid,gidNumber=gid ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Entry 1: uid=userone,ou=users,dc=example,dc=com dn: uid=userone,ou=users,dc=example,dc=com cn: Firtname Lastname displayname: Firtname Lastname givenname: Firstname mail: userone@example.com objectclass: inetOrgPerson objectclass: top sn: Lastname uid: userone userpassword: {SHA}0P/ssspVCIZx8+tVsss=
No uidNumber nor gidNumber nor homeDirectory here.
but authentication fails with the follwing error , Please Advice
Apr 19 08:18:50 localhost dovecot: auth(default): ldap(userone,127.0.0.1): result: uid(user)=userone userPassword(password)=<hidden> Apr 19 08:18:50 localhost dovecot: auth(default): client out: OK#0111#011user=userone
LDAP authentification succeeds.
Apr 19 08:18:50 localhost dovecot: auth(default): ldap(userone,127.0.0.1): user search: base=ou=users,dc=example,dc=com scope=subtree filter=(uid=userone) fields=homeDirectory,uidNumber,gidNumber
Now requesting the LDAP attributes you've specified, ...
Apr 19 08:18:51 localhost dovecot: auth(default): ldap(userone,127.0.0.1): no fields returned by the server
..., but none there.
Apr 19 08:18:51 localhost dovecot: auth(default): master out: USER#0111#011userone Apr 19 08:18:51 localhost dovecot: dovecot: User userone is missing UID (see mail_uid setting)
Dovecot does not know, which uid to use. Either assign global mail_uid and mail_gid or add mailUid and mailGid attributes to your LDAP items.
Next problem will be the missing homeDirectory ... .
Apr 19 08:18:51 localhost dovecot: imap-login: Internal login failure (auth failed, 1 attempts): user=<userone>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBUXFYdV3r2wJMiz2NAQJmrwf/U5six5ut3Z+QwfFvm+mSgyXz44nhWnsB EozjS2ULT4MtOUWZacDLooQf6FYh+7gOUwpCOqeBHfOcQvW5p5gTflJU4S+WdDgL Vuq9IeUcbcaHOOTrEuuenOMuI0nZLB1pv9Rz7KjeRfgAr9H/v4GmirYj9+cuHrWs jSWjwN+lOj1FmOp7U1F3UAZoibQOTi9JdgUm7MgEOB6v5QobG+oxpiA7Xkl/MXAY Ip3BOo7qWsuwXVuSnI/9bH7jDk4yK0jitHulsYY5+yl2ePvF86hOLxv60oliyVkI qkIRd1W8aWLnz9lPTdiL2N5eKOXWpHi0gZYyrVe8vYxVYxrdpgSMmQ== =t29J -----END PGP SIGNATURE-----
participants (2)
-
Steffen Kaiser
-
val john