[Dovecot] Multiple "mail" field in one LDAP account
Hello all!
#pkg_info | grep dovecot dovecot-1.1.3_1 dovecot-managesieve-0.10.3 dovecot-sieve-1.1.5_1
Im trying to do this: Im have a LDAP account with multiple "mail" field like this(many strings cuted):
dn: uid=k.proskurin,ou=Users,dc=Moscow,dc=CAS uid: k.proskurin userPassword: {CRYPT}$1$ETadxf6G$O2bNUQVSHxksUp08V/iY2. mail: sysadmin@domain.off mail: proskurin-kv@domain.off
My dovecot user "mail" as login:
user_filter = (&(objectClass=mailUser)(mail=%u)) pass_attrs = mail=user,userPassword=password pass_filter = (&(objectClass=mailUser)(mail=%u))
All seems work well before im add second mail field in account. In logs in see this:
Info: auth(default): client in: AUTH 1 PLAIN service=imap secured lip=172.16.1.19 rip=172.16.1.19 lport=143 rport=64575 resp=<hidden>
Info: auth(default): ldap(proskurin-kv@domain.off,172.16.1.19): pass search: base=dc=CAS scope=subtree filter=(&(objectClass=mailUser)(mail=proskurin-kv@domain.off)) fields=mail,userPassword Info: auth(default): auth(proskurin-kv@domain.off,172.16.1.19): username changed proskurin-kv@domain.off -> sysadmin@domain.off
Info: auth(default): auth(sysadmin@domain.off,172.16.1.19): username changed sysadmin@domain.off -> proskurin-kv@domain.off
Info: auth(default): ldap(proskurin-kv@domain.off,172.16.1.19): result: userPassword(password)=<hidden> mail(user)=sysadmin@domain.off/proskurin-kv@domain.off
Info: auth(default): client out: OK 1 user=proskurin-kv@domain.off
Info: auth(default): master in: REQUEST 8 38582 1
Info: auth(default): master out: USER 8 proskurin-kv@domain.off uid=1002 gid=1002 home=/var/spool/dovecot/domains/domain.off/proskurin-kv
Info: imap-login: Login: user=proskurin-kv@domain.off, method=PLAIN, rip=172.16.1.19, lip=172.16.1.19, secured
And in my Thunderbird then im log by sysadmin@domain.off in see proskurin-kv@domain.off mail.
Oh - what is happening? Why it is jump from one to another? They have differnent login and same password. If it is possible to make this work well?
-- Best regards, Proskurin Kirill
On Oct 16, 2008, at 12:09 PM, Proskurin Kirill wrote:
pass_attrs = mail=user,userPassword=password
You could remove the mail=user here and instead set
auth_username_format=%Lu to make sure the username is lowercased.
Info: auth(default): auth(proskurin-kv@domain.off,172.16.1.19):
username changed proskurin-kv@domain.off -> sysadmin@domain.off
Dovecot sees the first mail field and changes the username.
Info: auth(default): auth(sysadmin@domain.off,172.16.1.19): username
changed sysadmin@domain.off -> proskurin-kv@domain.off
Dovecot sees the second mail field and changes the username again.
Timo Sirainen wrote:
On Oct 16, 2008, at 12:09 PM, Proskurin Kirill wrote:
pass_attrs = mail=user,userPassword=password
You could remove the mail=user here and instead set auth_username_format=%Lu to make sure the username is lowercased.
Thanks Timo - seems this work! But now im don`t really understand how he lookup user name in LDAP now.
Thunder bird send credentials: login: sysadmin@domain.off pass: 123
Dovecot makes LDAP lookup and search user with such pass in userPassword and such login in were?
Info: auth(default): ldap(sysadmin@domain.off,172.16.1.80): pass search: base=dc=CAS scope=subtree filter=(&(objectClass=mailUser)(mail=sysadmin@domain.off)) fields=userPassword
Info: auth(default): ldap(sysadmin@domain.off,172.16.1.80): result: userPassword(password)=<hidden>
Info: auth(default): client out: OK 1 user=sysadmin@domain.off
-- Best regards, Proskurin Kirill
Yes I understand - it must be a stupid question but could some one explain it to me? Im aware of problems what lack of understanding may give.
Proskurin Kirill wrote:
Timo Sirainen wrote:
On Oct 16, 2008, at 12:09 PM, Proskurin Kirill wrote:
pass_attrs = mail=user,userPassword=password
You could remove the mail=user here and instead set auth_username_format=%Lu to make sure the username is lowercased.
Thanks Timo - seems this work! But now im don`t really understand how he lookup user name in LDAP now.
Thunderbird send credentials: login: sysadmin@domain.off pass: 123
Dovecot makes LDAP lookup and search user with such pass in userPassword and such login in were?
Info: auth(default): ldap(sysadmin@domain.off,172.16.1.80): pass search: base=dc=CAS scope=subtree filter=(&(objectClass=mailUser)(mail=sysadmin@domain.off)) fields=userPassword
Info: auth(default): ldap(sysadmin@domain.off,172.16.1.80): result: userPassword(password)=<hidden>
Info: auth(default): client out: OK 1 user=sysadmin@domain.off
-- Best regards, Proskurin Kirill
On Thu, 2008-10-16 at 14:18 +0400, Proskurin Kirill wrote:
Timo Sirainen wrote:
On Oct 16, 2008, at 12:09 PM, Proskurin Kirill wrote:
pass_attrs = mail=user,userPassword=password
You could remove the mail=user here and instead set auth_username_format=%Lu to make sure the username is lowercased.
Thanks Timo - seems this work! But now im don`t really understand how he lookup user name in LDAP now.
The lookup is done exactly the same way as before, in both cases LDAP server returns only a single result. Only now it doesn't use the looked up "mail" value for anything.
Thunder bird send credentials: login: sysadmin@domain.off pass: 123
Dovecot makes LDAP lookup and search user with such pass in userPassword and such login in were?
The search is done with the user name. From that result it uses the userPassword to verify validity of the password.
participants (2)
-
Proskurin Kirill
-
Timo Sirainen