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 m...@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 m...@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(m...@example.org,5.6.7.8): lookup 
service=dovecot
May 20 12:14:57 auth-worker: Debug: pam(m...@example.org,5.6.7.8): #1/1 style=1 
msg=Password: 
May 20 12:15:00 auth-worker: Debug: sql(m...@example.org,5.6.7.8): query: 
SELECT email as user, password FROM view_users WHERE email='m...@example.org';
May 20 12:15:00 auth: Debug: client out: OK     1       user=m...@example.org
May 20 12:15:00 auth: Debug: master in: REQUEST 4018667521      25337   1       
ccd274c0359454ad3beae53ccb1cc03b
May 20 12:15:00 auth: Debug: passwd(m...@example.org,5.6.7.8): lookup
May 20 12:15:00 auth: Debug: prefetch(m...@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(m...@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(m...@example.org,5.6.7.8): query: 
SELECT email as user, password FROM view_users WHERE email='m...@example.org';
May 20 12:42:51 auth-worker: Debug: sql(m...@example.org,5.6.7.8): 
PLAIN-MD5(thisisthewrongpassword) != '7d7ba8201b765ffd4b212268b8c34d1c'
May 20 12:42:53 auth: Debug: client out: FAIL   1       user=m...@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


Reply via email to