[Dovecot] userdb prefetch not working for passdb sql

Daniel Watts d at nielwatts.com
Mon Mar 27 02:37:40 EEST 2006



> Hi all,
>
> I'm using 1.0.beta3 and having problems using userdb prefetch in conjuction with passdb sql.  Here are my mail logs when I log to virtual account "testuser at mydomain.com" by doing "telnet localhost 143":
>
> Mar 26 15:15:47 imapserver dovecot: Dovecot v1.0.beta3 starting up
> Mar 26 15:15:49 imapserver dovecot: auth-worker(default): mysql: Connected to (null) (mail)
> Mar 26 15:16:03 imapserver dovecot: auth(default): client in: AUTH      1       PLAIN   service=IMAP    secured lip=127.0.0.1   rip=127.0.0.1   resp=<hidden>
> Mar 26 15:16:03 imapserver dovecot: auth-worker(default): sql(testuser at mydomain.com,127.0.0.1): query: ***snipped, very long***
> Mar 26 15:16:03 imapserver dovecot: auth(default): client out: OK       1       user=testuser at mydomain.com    
> Mar 26 15:16:03 imapserver dovecot: auth(default): master in: REQUEST   1       16001   1
> Mar 26 15:16:03 imapserver dovecot: auth(default): passwd(testuser at mydomain.com,127.0.0.1): unknown user
> Mar 26 15:16:03 imapserver dovecot: auth(default): prefetch(testuser at mydomain.com,127.0.0.1): userdb_uid not returned
> Mar 26 15:16:03 imapserver dovecot: auth(default): prefetch(testuser at mydomain.com,127.0.0.1): userdb_gid not returned
> Mar 26 15:16:03 imapserver dovecot: auth(default): userdb(testuser at mydomain.com,127.0.0.1): user not found from userdb
> Mar 26 15:16:03 imapserver dovecot: auth(default): master out: NOTFOUND 1
> Mar 26 15:16:03 imapserver dovecot: imap-login: Internal login failure: user=<testuser at mydomain.com>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
>
> The MySQL query is long and complicated, but here's what it returned when I copied and pasted it into mysql:
>
> user         testuser at mydomain.com
> password     {SSHA}BRuPgonpb8Zd+0NaFH2G6dT47m3mT43w
> userdb_home  /var/mail/mydomain.com/testuser
> userdb_uid   vmail
> userdb_gid   vmail
>
> All of these values are correct.  It seems to be ignoring the userdb_* fields.  It works when I don't use prefetch, and it also works when I do use prefetch but change the SQL query to return "testuser" instead of "testuser at mydomain.com" in the user field.  Anyone know why?
>
>   
This is what my logs say also using mysql + prefetch:

Mar 27 00:32:41 tg1 dovecot: auth(default): client in: AUTH     1       
PLAIN   service=IMAP    secured lip=127.0.0.1   rip=127.0.0.1       
resp=AGRhbkBhbHVtaW5hdGkubmV0AHBhc3Mx
Mar 27 00:32:41 tg1 dovecot: auth-worker(default): mysql: Connected to 
localhost (mydb)
Mar 27 00:32:41 tg1 dovecot: auth-worker(default): 
sql(dan at domain.net,127.0.0.1): query: SELECT concat(username,"@",domain) 
as user, password, mailenv as userdb_mail, uid as userdb_uid, gid as 
userdb_gid FROM users WHERE username = 'dan' AND domain = 'domain.net'
Mar 27 00:32:41 tg1 dovecot: auth(default): client out: OK      1       
user=dan at domain.net
Mar 27 00:32:41 tg1 dovecot: auth(default): master in: REQUEST  110     
9236    1
Mar 27 00:32:41 tg1 dovecot: auth(default): master out: USER    110     
dan at domain.net       
mail=/home/virtual/domain.net/home/dan/:INBOX=/home/virtual/domain.net/var/spool/mail/dan     
uid=505 gid=505
Mar 27 00:32:41 tg1 dovecot: imap(dan at domain.net): Effective uid=505, 
gid=505


It all seems to come down to that "master in: REQUEST" line. Not sure 
what the difference is but may be that'll give you a clue?

Daniel


More information about the dovecot mailing list