[Dovecot] userdb prefetch not working for passdb sql
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@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@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@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@mydomain.com,127.0.0.1): unknown user Mar 26 15:16:03 imapserver dovecot: auth(default): prefetch(testuser@mydomain.com,127.0.0.1): userdb_uid not returned Mar 26 15:16:03 imapserver dovecot: auth(default): prefetch(testuser@mydomain.com,127.0.0.1): userdb_gid not returned Mar 26 15:16:03 imapserver dovecot: auth(default): userdb(testuser@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@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@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@mydomain.com" in the user field. Anyone know why? Here's my dovecot.conf in case it proves useful: first_valid_uid = 900 mail_debug = yes default_mail_env = maildir:%h/.maildir maildir_copy_with_hardlinks = yes protocol imap { login_greeting_capability = yes } protocol pop3 { } auth_verbose = yes auth_debug = yes auth default { mechanisms = plain passdb sql { args = /etc/dovecot/dovecot-sql.conf } passdb pam { args = "*" } userdb passwd { } userdb prefetch { } user = root } plugin { } Thanks!
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@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@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@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@mydomain.com,127.0.0.1): unknown user Mar 26 15:16:03 imapserver dovecot: auth(default): prefetch(testuser@mydomain.com,127.0.0.1): userdb_uid not returned Mar 26 15:16:03 imapserver dovecot: auth(default): prefetch(testuser@mydomain.com,127.0.0.1): userdb_gid not returned Mar 26 15:16:03 imapserver dovecot: auth(default): userdb(testuser@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@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@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@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@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@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@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@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
On Sun, 2006-03-26 at 16:43 -0500, dovecot-ri wrote:
The MySQL query is long and complicated, but here's what it returned when I copied and pasted it into mysql:
user testuser@mydomain.com password {SSHA}BRuPgonpb8Zd+0NaFH2G6dT47m3mT43w userdb_home /var/mail/mydomain.com/testuser userdb_uid vmail userdb_gid vmail
It would be faster to return numeric uid/gid so Dovecot doesn't have to look them up.
passdb sql { args = /etc/dovecot/dovecot-sql.conf } passdb pam { args = "*" } userdb passwd { } userdb prefetch { }
Have you tried without pam/passwd? I think the "userdb passwd" makes it forget about the userdb_* fields. I'm not sure how good idea it's in any case to use prefetch with multiple passdbs..
participants (3)
-
Daniel Watts
-
dovecot-ri
-
Timo Sirainen