[Dovecot] Double mysql auth problem
Hello , I am forced to use 2 DBs to auth users. First one is for our CRM system (new user=mail from him/her) , second is for other (cannot user CRM DB :( ) Postfix have no problem to deliver mails to both DBs but I've some problems with reciveing mails from second (not CRM) DB.
The dovecot.conf : protocols = imap pop3 imaps disable_plaintext_auth = no mail_location = maildir:/home/vmail/%d/%n log_path = /var/log/dovecot ssl_disable = no ssl_cert_file = /etc/ssl/certs/dovecot.pem ssl_key_file = /etc/ssl/private/dovecot.pem auth_verbose = yes auth_debug = yes auth_debug_passwords = yes
auth default { passdb sql { args = /etc/dovecot/dovecot-mysql.conf }
userdb static { args = uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes } } auth secondary { passdb sql { args = /etc/dovecot/dovecot-mysql2.conf } userdb static { args = uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes } }
dovecot-mysql.conf : driver = mysql connect = host=127.0.0.1 dbname= user= password= default_pass_scheme = CRYPT password_query = SELECT email as user, haslo as password FROM users WHERE email='%u';
dovecot-mysql2.conf : driver = mysql connect = host=127.0.0.1 dbname= user= password= default_pass_scheme = CRYPT password_query = SELECT email as user, password FROM poczta WHERE email='%u';
I could log on mail located in dovecot-mysql.conf (CRM) but when I try
to log on second DB I got errors :
dovecot: Mar 30 14:41:01 Info: auth(default): client in:
AUTH 1 PLAIN service=imap secured lip=127.0.0.1
rip=127.0.0.1 lport=993 rport=32930
resp=AGdyb21AZXVyaW1hZ2UucGwANzEyMA==
dovecot: Mar 30 14:41:01 Info: auth-worker(default):
sql(grom@eurimage.pl,127.0.0.1): query: SELECT email as user, haslo as
password FROM users WHERE email='grom@eurimage.pl';
dovecot: Mar 30 14:41:01 Info: auth-worker(default):
sql(grom@eurimage.pl,127.0.0.1): unknown user
dovecot: Mar 30 14:41:01 Info: auth(default): new auth connection:
pid=19560
dovecot: Mar 30 14:41:01 Info: auth(secondary): new auth connection:
pid=19560
dovecot: Mar 30 14:41:03 Info: auth(default): client out:
FAIL 1 user=grom@eurimage.pl
dovecot: Mar 30 14:41:03 Info: imap-login: Disconnected (auth failed, 1
attempts): user=grom@eurimage.pl, method=PLAIN, rip=127.0.0.1,
lip=127.0.0.1, TLS
I see query for auth default but got no isea why there's no query for auth secondary ? Waiting for some help :)
On Mar 30, 2009, at 9:00 AM, Sebastian Chociwski wrote:
auth default { passdb sql { args = /etc/dovecot/dovecot-mysql.conf }
userdb static { args = uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes } } auth secondary { passdb sql { args = /etc/dovecot/dovecot-mysql2.conf } userdb static { args = uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes } }
Don't use two auth {} blocks. It doesn't work the way you think it
does.You can put multiple passdbs and userdbs inside the same auth
block, but you can't put two userdb statics there. The first one will
always match all users. But since they both are identical it doesn't
matter, just put it there once.
participants (2)
-
Sebastian Chociwski
-
Timo Sirainen