I have dovecot-1.0-test64 installed on OpenBSD-3.6. It works fine with local password.
Now I fail to get dovecot to use MySQL to query for user details. Any help would be very appreciated.
Here are the details:
from /var/log/maillog:
with "default_pass_scheme = PLAIN"
Apr 3 07:20:22 www dovecot: Dovecot v1.0-test64 starting up Apr 3 07:20:23 www dovecot: auth(default): mysql: Connected to (null) (dovecot) Apr 3 07:20:23 www dovecot: auth-worker(default): mysql: Connected to (null) (dovecot) Apr 3 07:20:50 www dovecot: auth(default): client in: AUTH 1 PLAIN service=IMAP secured lip=1.2.3.4 rip=5.6.7.8 resp=AGhhemVsQGhhemVscGhhbS5jb20AemhAMTlTQXZl Apr 3 07:20:50 www dovecot: auth-worker(default): sql(client@clientdomain.com,5.6.7.8): query: SELECT pass AS password FROM user WHERE user = 'client@clientdomain.com' Apr 3 07:20:50 www dovecot: auth(default): blocking(client@clientdomain.com,5.6.7.8): Received reply from worker without password scheme Apr 3 07:20:51 www dovecot: auth(default): client out: FAIL 1 user=client@clientdomain.com temp Apr 3 07:21:50 www dovecot: imap-login: Disconnected: Inactivity [5.6.7.8]
with "default_pass_scheme = PLAIN-MD5" Apr 3 07:07:13 www dovecot: Dovecot v1.0-test64 starting up Apr 3 07:07:14 www dovecot: auth(default): mysql: Connected to (null) (dovecot) Apr 3 07:07:14 www dovecot: auth-worker(default): mysql: Connected to (null) (dovecot) Apr 3 07:07:47 www dovecot: auth(default): client in: AUTH 1 PLAIN service=IMAP se cured lip=1.2.3.4 rip=5.6.7.8 resp=AGhhemVsQGhhemVscGhhbS5jb20AemhAMTlTQXZl Apr 3 07:07:47 www dovecot: auth-worker(default): sql(client@clientdomain.com,5.6.7.8): query: SELECT pass AS password FROM user WHERE user = 'client@clientdomain.com' Apr 3 07:07:48 www dovecot: auth(default): client out: FAIL 1 user=client@clientdomain.com
Command to start dovecot: /usr/local/dovecot/sbin/dovecot -c /usr/local/dovecot/etc/dovecot.conf
Part of /usr/local/dovecot/etc/dovecot.conf: .... disable_plaintext_auth = no ....
# SQL database passdb sql { # Path for SQL configuration file, see doc/dovecot-sql.conf for # example args = /usr/local/dovecot/etc/dovecot-mysql.conf } ....
# SQL database userdb sql { # Path for SQL configuration file, see doc/dovecot-sql.conf for # example args = /usr/local/dovecot/etc/dovecot-mysql.conf } ....
I also tried with "disable_plaintext_auth = yes" without any luck.
/usr/local/dovecot-1.0-test64/etc/dovecot-mysql.conf: driver = mysql connect = host=/var/www/dovecot/mysql.sock dbname=dovecot user=dovecot password=secretpwDB default_pass_scheme = PLAIN password_query = SELECT pass AS password FROM user WHERE user = '%u' user_query = SELECT maildir AS mail, sysuid AS uid, sysgid AS gid FROM user WHERE user = '%n'
Manually query MySQL with username and passwd as specified in /usr/local/dovecot-1.0-test64/etc/dovecot-mysql.conf:
mysql> SELECT pass AS password FROM user WHERE user ='client@clientdomain.com'; +-----------+ | password | +-----------+ | secretpw | +-----------+ 1 row in set (0.00 sec)
mysql>
Thanks, Zoong