Re: [Dovecot] ldap login with userid

2010-01-22 Thread Timo Sirainen
On Fri, 2010-01-22 at 16:42 +0100, spamv...@googlemail.com wrote:
> currently im using:
> user_attrs = homeDirectory=home,uid=mail=maildir:/mail/%$
> user_filter = 
> (&(objectClass=gosaMailAccount)(|(mail=%u)(gosaMailAlternateAddress=%u)))
> to match the mailaddress and deliver the mail to the users homdir
> (/mail/uid_of_the_user)
> 
> But i cant login to dovecot:
> pass_attrs = uid=user,userPassword=password
> pass_filter = (&(objectClass=gosaMailAccount)(uid=%u))

passdb lookup succeeds, because uid=%u matches. But then you're doing a
userdb lookup from mail or gosaMailAlternateAddress, instead of from uid
field like with passdb.

Two possibilities I guess:

a) add |(uid=%u) to user_filter

b) Change username to gosaMailAccount's value in passdb lookup, by
using:

pass_attrs = gosaMailAccount=user,userPassword=password

Dunno which one would be correct in your case.


signature.asc
Description: This is a digitally signed message part


[Dovecot] ldap login with userid

2010-01-22 Thread spamvoll
hi..

Dovecot Version 1.2.9

im trying to login to dovecot with my ldap uid.

currently im using:
user_attrs = homeDirectory=home,uid=mail=maildir:/mail/%$
user_filter = 
(&(objectClass=gosaMailAccount)(|(mail=%u)(gosaMailAlternateAddress=%u)))
to match the mailaddress and deliver the mail to the users homdir
(/mail/uid_of_the_user)

But i cant login to dovecot:
pass_attrs = uid=user,userPassword=password
pass_filter = (&(objectClass=gosaMailAccount)(uid=%u))

the Log:
Jan 22 17:21:51 testimap dovecot: auth(default): client in:
AUTH1   PLAIN   service=imapsecured lip=10.0.0.15   rip=10.0.0.20   
lport=993   rport=36879
Jan 22 17:21:51 testimap dovecot: auth(default): client out: CONT   1   
Jan 22 17:21:51 testimap dovecot: auth(default): client in:
CONT1   AG1zbWlhdGVrAHRpYWFrdGVuZXI=
Jan 22 17:21:51 testimap dovecot: auth(default):
ldap(myuser,10.0.0.20): bind search: base=dc=example,dc=com
filter=(&(objectClass=gosaMailAccount)(uid=myuser))
Jan 22 17:21:51 testimap dovecot: auth(default):
ldap(myuser,10.0.0.20): result: uid(user)=myuser
Jan 22 17:21:51 testimap dovecot: auth(default): client out: OK 1   
user=myuser
Jan 22 17:21:51 testimap dovecot: auth(default): master in: REQUEST 1   
25411
Jan 22 17:21:51 testimap dovecot: auth(default):
passwd(myuser,10.0.0.20): lookup
Jan 22 17:21:51 testimap dovecot: auth(default):
passwd(myuser,10.0.0.20): unknown user
Jan 22 17:21:51 testimap dovecot: auth(default):
ldap(myuser,10.0.0.20): user search: base=dc=example,dc=com
scope=subtree 
filter=(&(objectClass=gosaMailAccount)(|(mail=myuser)(gosaMailAlternateAddress=myuser)))
fields=homeDirectory,uid
Jan 22 17:21:51 testimap dovecot: auth(default):
ldap(myuser,10.0.0.20): Unknown user
Jan 22 17:21:51 testimap dovecot: auth(default):
userdb(myuser,10.0.0.20): user not found from any userdbs
Jan 22 17:21:51 testimap dovecot: auth(default): master out: NOTFOUND   1
Jan 22 17:21:51 testimap dovecot: imap-login: Internal login failure
(auth failed, 1 attempts): user=, method=PLAIN, rip=10.0.0.20,
lip=10.0.0.15, TLS

any ideas ?