Upgrading from SLES11 to SLES 12 I had to replace a working Cyrus mail server with dovecot. Unfortunately I'm unable to authenticate via LDAP (which was not a problem with Cyrus):
My LDAP user has two uid attributes. When authenticating via IMAP dovecot detects that (Warning: ldap(*uid*,*IP*,<*SID*>): Multiple values found for '*uid*', using '*uid2*').
While this shouldn't be a problem, authentication fails with no further message. How can I authenticate without changing my LDAP user? (In UNIX/PAM I can login using either uid)
This is my /etc/dovecot/dovecot-ldap.conf.ext (most comments removed for brevity, and actual domain changed (not reachable anyway)):
# This file is commonly accessed via passdb {} or userdb {} section in
# conf.d/auth-ldap.conf.ext
hosts = ds2.domain.org ds1.domain.org
tls = yes
tls_require_cert = demand
debug_level = 0
auth_bind_userdn = uid=%u,ou=people,dc=domain,dc=org
ldap_version = 3
base = ou=people,dc=domain,dc=org
scope = onelevel
# User attributes are given in LDAP-name=dovecot-internal-name list. The
# internal names are:
# uid - System UID
# gid - System GID
# home - Home directory
# mail - Mail location
user_attrs = homeDirectory=home,uidNumber=uid,gidNumber=gid
# Filter for user lookup. Some variables can be used (see
# http://wiki2.dovecot.org/Variables for full list):
# %u - username
# %n - user part in user@domain, same as %u if there's no domain
# %d - domain part in user@domain, empty if user there's no domain
user_filter = (&(objectClass=posixAccount)(uid=%n))
pass_attrs = uid=%n,userPassword=password
pass_filter = (&(objectClass=posixAccount)(uid=%u))
iterate_attrs = uid=user
iterate_filter = (objectClass=posixAccount)
default_pass_scheme = SSHA
So what's needed IMHO is a way to make dovecot continue with the user name that was used to query the userdb and passdb. Instead it continues with the one returned from LDAP.