[Dovecot] Dovecot 2 fails after correct login
Hello
I installed dovecot 2.0.9 (and dovecot-mysql!) on my Ubuntu 12.04 LTS root-server to work together with Postfix 2.9.1-4 After some struggle, I got Postfix's auth working, using dovecot for smtp-authentification with mysql.
But dovecot himself is not working properly. When I connect, after giving plaintext password I read the error in the client (I connect for debug reasons with a dos-box on windows):
telnet example.org 110 +OK Dovecot ready. USER me@example.org +OK PASS myplainpassword -ERR [IN-USE] Internal error occurred. Refer to server log for more information.
If I do:
... PASS thisisthewrongpassword
I get:
-ERR Authentication failed.
And this is the debug-log (I changed IP and names, server to 1.2.3.4 me to 5.6.7.8 server-name to example.org, my email to me@example.org):
May 20 12:14:54 auth: Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth May 20 12:14:54 auth: Debug: Module loaded: /usr/lib/dovecot/modules/auth/libdriver_mysql.so May 20 12:14:54 auth: Debug: auth client connected (pid=25337) May 20 12:14:57 auth: Debug: client in: AUTH 1 PLAIN service=pop3 lip=1.2.3.4 rip=5.6.7.8 lport=110 rport=1731 resp=AGZyYW5jQGV3Ni5vcmcAMzE0MTU= May 20 12:14:57 auth-worker: Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth May 20 12:14:57 auth-worker: Debug: Module loaded: /usr/lib/dovecot/modules/auth/libdriver_mysql.so May 20 12:14:57 auth-worker: Debug: pam(me@example.org,5.6.7.8): lookup service=dovecot May 20 12:14:57 auth-worker: Debug: pam(me@example.org,5.6.7.8): #1/1 style=1 msg=Password: May 20 12:15:00 auth-worker: Debug: sql(me@example.org,5.6.7.8): query: SELECT email as user, password FROM view_users WHERE email='me@example.org'; May 20 12:15:00 auth: Debug: client out: OK 1 user=me@example.org May 20 12:15:00 auth: Debug: master in: REQUEST 4018667521 25337 1 ccd274c0359454ad3beae53ccb1cc03b May 20 12:15:00 auth: Debug: passwd(me@example.org,5.6.7.8): lookup May 20 12:15:00 auth: Debug: prefetch(me@example.org,5.6.7.8): passdb didn't return userdb entries, trying the next userdb May 20 12:15:00 auth-worker: Debug: sql(me@example.org,5.6.7.8): SELECT home, uid, gid FROM users WHERE username = 'me' AND domain = 'example.org' May 20 12:15:00 auth: Debug: master out: FAIL 4018667521
And with wrong password: ... May 20 12:42:51 auth-worker: Debug: sql(me@example.org,5.6.7.8): query: SELECT email as user, password FROM view_users WHERE email='me@example.org'; May 20 12:42:51 auth-worker: Debug: sql(me@example.org,5.6.7.8): PLAIN-MD5(thisisthewrongpassword) != '7d7ba8201b765ffd4b212268b8c34d1c' May 20 12:42:53 auth: Debug: client out: FAIL 1 user=me@example.org
I don't understand the error messages (yet), could somebody please give me a hint?
My dovecot.conf:
passdb { driver = sql args = /etc/dovecot/dovecot-sql.conf } userdb { driver = prefetch } userdb { driver = sql args = /etc/dovecot/dovecot-sql.conf }
dovecot-sql.conf:
driver = mysql connect = host=127.0.0.1 dbname=maildb user=mailuser password=mailpassword default_pass_scheme = PLAIN-MD5 password_query = SELECT email as user, password FROM view_users WHERE email='%u';
10-auth.conf:
disable_plaintext_auth = no auth_mechanisms = plain !include auth-system.conf.ext
and in my 10-master.conf I have:
service imap-login { inet_listener imap { } inet_listener imaps { } } service pop3-login { inet_listener pop3 { } inet_listener pop3s { } } service lmtp { unix_listener lmtp { } } service imap { } service pop3 { } service auth { unix_listener auth-userdb { mode = 0660 } unix_listener /var/spool/postfix/private/auth { mode = 0666 user = postfix group = postfix } } service auth-worker { } service dict { unix_listener dict { } }
I enabled logging in 10-logging.conf, enabled ssl in 10-ssl.conf and put the path in 10-mail.conf. Beside this I didn't change the defaults.
Thank you for help!
frank
Do u not need a seperate user_query in your dovecot-sql.conf to return the. Dovecot is complaining that it can't find the entries that should be returned from this query (I believe!)
On 20/05/12 12:12, Frank Walter wrote:
Hello
I installed dovecot 2.0.9 (and dovecot-mysql!) on my Ubuntu 12.04 LTS root-server to work together with Postfix 2.9.1-4 After some struggle, I got Postfix's auth working, using dovecot for smtp-authentification with mysql.
But dovecot himself is not working properly. When I connect, after giving plaintext password I read the error in the client (I connect for debug reasons with a dos-box on windows):
telnet example.org 110 +OK Dovecot ready. USER me@example.org +OK PASS myplainpassword -ERR [IN-USE] Internal error occurred. Refer to server log for more information.
If I do:
... PASS thisisthewrongpassword
I get:
-ERR Authentication failed.
And this is the debug-log (I changed IP and names, server to 1.2.3.4 me to 5.6.7.8 server-name to example.org, my email to me@example.org):
May 20 12:14:54 auth: Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth May 20 12:14:54 auth: Debug: Module loaded: /usr/lib/dovecot/modules/auth/libdriver_mysql.so May 20 12:14:54 auth: Debug: auth client connected (pid=25337) May 20 12:14:57 auth: Debug: client in: AUTH 1 PLAIN service=pop3 lip=1.2.3.4 rip=5.6.7.8 lport=110 rport=1731 resp=AGZyYW5jQGV3Ni5vcmcAMzE0MTU= May 20 12:14:57 auth-worker: Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth May 20 12:14:57 auth-worker: Debug: Module loaded: /usr/lib/dovecot/modules/auth/libdriver_mysql.so May 20 12:14:57 auth-worker: Debug: pam(me@example.org,5.6.7.8): lookup service=dovecot May 20 12:14:57 auth-worker: Debug: pam(me@example.org,5.6.7.8): #1/1 style=1 msg=Password: May 20 12:15:00 auth-worker: Debug: sql(me@example.org,5.6.7.8): query: SELECT email as user, password FROM view_users WHERE email='me@example.org'; May 20 12:15:00 auth: Debug: client out: OK 1 user=me@example.org May 20 12:15:00 auth: Debug: master in: REQUEST 4018667521 25337 1 ccd274c0359454ad3beae53ccb1cc03b May 20 12:15:00 auth: Debug: passwd(me@example.org,5.6.7.8): lookup May 20 12:15:00 auth: Debug: prefetch(me@example.org,5.6.7.8): passdb didn't return userdb entries, trying the next userdb May 20 12:15:00 auth-worker: Debug: sql(me@example.org,5.6.7.8): SELECT home, uid, gid FROM users WHERE username = 'me' AND domain = 'example.org' May 20 12:15:00 auth: Debug: master out: FAIL 4018667521
And with wrong password: ... May 20 12:42:51 auth-worker: Debug: sql(me@example.org,5.6.7.8): query: SELECT email as user, password FROM view_users WHERE email='me@example.org'; May 20 12:42:51 auth-worker: Debug: sql(me@example.org,5.6.7.8): PLAIN-MD5(thisisthewrongpassword) != '7d7ba8201b765ffd4b212268b8c34d1c' May 20 12:42:53 auth: Debug: client out: FAIL 1 user=me@example.org
I don't understand the error messages (yet), could somebody please give me a hint?
My dovecot.conf:
passdb { driver = sql args = /etc/dovecot/dovecot-sql.conf } userdb { driver = prefetch } userdb { driver = sql args = /etc/dovecot/dovecot-sql.conf }
dovecot-sql.conf:
driver = mysql connect = host=127.0.0.1 dbname=maildb user=mailuser password=mailpassword default_pass_scheme = PLAIN-MD5 password_query = SELECT email as user, password FROM view_users WHERE email='%u';
10-auth.conf:
disable_plaintext_auth = no auth_mechanisms = plain !include auth-system.conf.ext
and in my 10-master.conf I have:
service imap-login { inet_listener imap { } inet_listener imaps { } } service pop3-login { inet_listener pop3 { } inet_listener pop3s { } } service lmtp { unix_listener lmtp { } } service imap { } service pop3 { } service auth { unix_listener auth-userdb { mode = 0660 } unix_listener /var/spool/postfix/private/auth { mode = 0666 user = postfix group = postfix } } service auth-worker { } service dict { unix_listener dict { } }
I enabled logging in 10-logging.conf, enabled ssl in 10-ssl.conf and put the path in 10-mail.conf. Beside this I didn't change the defaults.
Thank you for help!
frank
-- Tim Smith Tel: 01423 564 078 Mob: 07984 398 299 Email: info@titan21.co.uk Web: www.titan21.co.uk
Sorry - seem to have missed the crucial part of my email!! I meant to say:
Do u not need a separate user_query in your dovecot-sql.conf to return the userdb data?
Sorry!
On 20/05/12 12:25, Tim Smith wrote:
Do u not need a seperate user_query in your dovecot-sql.conf to return the. Dovecot is complaining that it can't find the entries that should be returned from this query (I believe!)
On 20/05/12 12:12, Frank Walter wrote:
Hello
I installed dovecot 2.0.9 (and dovecot-mysql!) on my Ubuntu 12.04 LTS root-server to work together with Postfix 2.9.1-4 After some struggle, I got Postfix's auth working, using dovecot for smtp-authentification with mysql.
But dovecot himself is not working properly. When I connect, after giving plaintext password I read the error in the client (I connect for debug reasons with a dos-box on windows):
telnet example.org 110 +OK Dovecot ready. USER me@example.org +OK PASS myplainpassword -ERR [IN-USE] Internal error occurred. Refer to server log for more information.
If I do:
... PASS thisisthewrongpassword
I get:
-ERR Authentication failed.
And this is the debug-log (I changed IP and names, server to 1.2.3.4 me to 5.6.7.8 server-name to example.org, my email to me@example.org):
May 20 12:14:54 auth: Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth May 20 12:14:54 auth: Debug: Module loaded: /usr/lib/dovecot/modules/auth/libdriver_mysql.so May 20 12:14:54 auth: Debug: auth client connected (pid=25337) May 20 12:14:57 auth: Debug: client in: AUTH 1 PLAIN
service=pop3 lip=1.2.3.4 rip=5.6.7.8 lport=110
rport=1731 resp=AGZyYW5jQGV3Ni5vcmcAMzE0MTU= May 20 12:14:57 auth-worker: Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth May 20 12:14:57 auth-worker: Debug: Module loaded: /usr/lib/dovecot/modules/auth/libdriver_mysql.so May 20 12:14:57 auth-worker: Debug: pam(me@example.org,5.6.7.8): lookup service=dovecot May 20 12:14:57 auth-worker: Debug: pam(me@example.org,5.6.7.8): #1/1 style=1 msg=Password: May 20 12:15:00 auth-worker: Debug: sql(me@example.org,5.6.7.8): query: SELECT email as user, password FROM view_users WHERE email='me@example.org'; May 20 12:15:00 auth: Debug: client out: OK 1 user=me@example.org May 20 12:15:00 auth: Debug: master in: REQUEST 4018667521
25337 1 ccd274c0359454ad3beae53ccb1cc03b May 20 12:15:00 auth: Debug: passwd(me@example.org,5.6.7.8): lookup May 20 12:15:00 auth: Debug: prefetch(me@example.org,5.6.7.8): passdb didn't return userdb entries, trying the next userdb May 20 12:15:00 auth-worker: Debug: sql(me@example.org,5.6.7.8): SELECT home, uid, gid FROM users WHERE username = 'me' AND domain = 'example.org' May 20 12:15:00 auth: Debug: master out: FAIL 4018667521And with wrong password: ... May 20 12:42:51 auth-worker: Debug: sql(me@example.org,5.6.7.8): query: SELECT email as user, password FROM view_users WHERE email='me@example.org'; May 20 12:42:51 auth-worker: Debug: sql(me@example.org,5.6.7.8): PLAIN-MD5(thisisthewrongpassword) != '7d7ba8201b765ffd4b212268b8c34d1c' May 20 12:42:53 auth: Debug: client out: FAIL 1
user=me@example.orgI don't understand the error messages (yet), could somebody please give me a hint?
My dovecot.conf:
passdb { driver = sql args = /etc/dovecot/dovecot-sql.conf } userdb { driver = prefetch } userdb { driver = sql args = /etc/dovecot/dovecot-sql.conf }
dovecot-sql.conf:
driver = mysql connect = host=127.0.0.1 dbname=maildb user=mailuser password=mailpassword default_pass_scheme = PLAIN-MD5 password_query = SELECT email as user, password FROM view_users WHERE email='%u';
10-auth.conf:
disable_plaintext_auth = no auth_mechanisms = plain !include auth-system.conf.ext
and in my 10-master.conf I have:
service imap-login { inet_listener imap { } inet_listener imaps { } } service pop3-login { inet_listener pop3 { } inet_listener pop3s { } } service lmtp { unix_listener lmtp { } } service imap { } service pop3 { } service auth { unix_listener auth-userdb { mode = 0660 } unix_listener /var/spool/postfix/private/auth { mode = 0666 user = postfix group = postfix } } service auth-worker { } service dict { unix_listener dict { } }
I enabled logging in 10-logging.conf, enabled ssl in 10-ssl.conf and put the path in 10-mail.conf. Beside this I didn't change the defaults.
Thank you for help!
frank
-- Tim Smith Tel: 01423 564 078 Mob: 07984 398 299 Email: info@titan21.co.uk Web: www.titan21.co.uk
Tim! Missing the "crucial part" of your mail made me scrutinize more exactly in the configuration parts of my dovecot installation. I discovered now, that in my previous (working) 1.0.10 Dovecot config. I have set the userdb to static:
userdb static { args = uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes }
So I will try with this again. Since yet, very thank you for your hint and enlightenment :)
Cheers
-----Ursprüngliche Nachricht----- Von: dovecot-bounces@dovecot.org [mailto:dovecot-bounces@dovecot.org] Im Auftrag von Tim Smith Gesendet: Sonntag, 20. Mai 2012 14:49 An: dovecot@dovecot.org Betreff: Re: [Dovecot] Dovecot 2 fails after correct login
Sorry - seem to have missed the crucial part of my email!! I meant to say:
Do u not need a separate user_query in your dovecot-sql.conf to return the userdb data?
Sorry!
Surely this was still a bit mistakely:
userdb static { args = uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes }
but it should be:
userdb static { driver = static args = uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes }
Dovecot talks, if I start him:
root@myserver:~# dovecot doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf: userdb is missing driver
:)
And now, after setting the user and group of the whole dir (which was just copied without the permissions owner and groups):
/home/vmail
to vmail:
chown -R vmail:vmail /home/vmail
THE GOOD DOVECOT IS WORKING!
Tank again, Tim!!!
Kinds, frank
-----Ursprüngliche Nachricht----- Von: dovecot-bounces@dovecot.org [mailto:dovecot-bounces@dovecot.org] Im Auftrag von Frank Walter Gesendet: Sonntag, 20. Mai 2012 15:32 An: 'Tim Smith'; dovecot@dovecot.org Betreff: Re: [Dovecot] Dovecot 2 fails after correct login
Tim! Missing the "crucial part" of your mail made me scrutinize more exactly in the configuration parts of my dovecot installation. I discovered now, that in my previous (working) 1.0.10 Dovecot config. I have set the userdb to static:
userdb static { args = uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes }
So I will try with this again. Since yet, very thank you for your hint and enlightenment :)
Cheers
-----Ursprüngliche Nachricht----- Von: dovecot-bounces@dovecot.org [mailto:dovecot-bounces@dovecot.org] Im Auftrag von Tim Smith Gesendet: Sonntag, 20. Mai 2012 14:49 An: dovecot@dovecot.org Betreff: Re: [Dovecot] Dovecot 2 fails after correct login
Sorry - seem to have missed the crucial part of my email!! I meant to say:
Do u not need a separate user_query in your dovecot-sql.conf to return the userdb data?
Sorry!
participants (2)
-
Frank Walter
-
Tim Smith