[Dovecot] Password auth with Postfixadmin & MySQL

James Dehnert jdehnert at norcalnetworks.com
Tue Sep 25 21:29:55 EEST 2007


I am trying to get Postfix, Dovecot, Postfixadmin, and MySQP all  
working together.  I'm using 1.0.5 atm.

I've hit a point where I can't seem top get dovecot to auth to the  
MySQL password database

It seems to see the user OK, but I can't seem to get a password match.

MySQL has password stored as MD5, as per Postfixadmin.  When I add  
plain-md5 to the auth mechanisms dovecot seems to use plain and fails.

 From dovecot.conf..

  # Space separated list of wanted authentication mechanisms:
   #   plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi
   # NOTE: See also disable_plaintext_auth setting.
   mechanisms = cram-md5 plain login
   #

dovecot log file...

dovecot: Sep 25 11:17:30 Info: pop3-login: Login:  
user=<jdehnert at dehnert.com>, method=PLAIN, rip=127.0.0.1,  
lip=127.0.0.1, secured
dovecot: Sep 25 11:19:54 Info: auth(default): client in: AUTH    
1       PLAIN   service=IMAP    secured lip=127.0.0.1    
rip=127.0.0.1   resp=<hidden>
dovecot: Sep 25 11:19:54 Info: auth-worker(default): sql 
(jdehnert at dehnert.com,127.0.0.1): query: SELECT username as user,  
password, concat('/var/vmail/',domain,'/',maildir) as userdb_home,  
concat('maildir:/var/vmail/',domain,'/',maildir) as userdb_mail, 101  
as userdb_uid, 101 as userdb_gid FROM mailbox WHERE username =  
'jdehnert at dehnert.com' AND active = '1'
dovecot: Sep 25 11:19:54 Info: auth-worker(default): sql 
(jdehnert at dehnert.com,127.0.0.1): Password mismatch
dovecot: Sep 25 11:19:54 Info: auth(default): client out: FAIL   
1       user=jdehnert at dehnert.com
dovecot: Sep 25 11:22:54 Info: imap-login: Disconnected: Inactivity:  
user=<jdehnert at dehnert.com>, method=PLAIN, rip=127.0.0.1,  
lip=127.0.0.1, secured

and the sql script thats called is has just minor tweaks...

driver = mysql
connect = host=localhost dbname=postfix user=postfix password=postfix
user_query = SELECT concat('/var/vmail/',domain,'/',maildir) as home,  
concat('maildir:/var/vmail/',domain,'/',maildir) \
   as mail, 101 AS uid, 101 AS gid, concat('maildir:storage=', quota)  
AS quota FROM mailbox WHERE username = '%u' AND \
   active = '1'
password_query = SELECT username as user, password, concat('/var/ 
vmail/',domain,'/',maildir) as \
   userdb_home, concat('maildir:/var/vmail/',domain,'/',maildir) as  
userdb_mail, 101 as userdb_uid, \
   101 as userdb_gid FROM mailbox WHERE username = '%u' AND active = '1'

  
  


More information about the dovecot mailing list