Michael Gabb
2005-Aug-09 09:20 UTC
[Dovecot] Failed authentication to a mysql database (bug or PEBKAC?)
Hello, I'm trying to setup a mailserver running postfix and dovecot with mysql as database backend. Postfix is already running and delivers mails just fine. Unfortunately, dovecot has great problems connecting to the database (using username + password). If I disable the password, everthing works fine. But, thats harakiri, security wise ;-) I tried dovecot-1.0-stable and the latest cvs-nightly (I think from August 9.). With both versions, I get the following error (there are little differences between the to versions, but the meaning ist the same...) dovecot: auth-worker(default): mysql: Connect failed to localhost (my_dbname): Access denied for user 'my_user'@'localhost' (using password: YES) - waiting for 1 seconds before retry My connect string is as follows: connect = host=/var/lib/mysql/mysql.sock user=my_user password=my_password dbname=my_dbname Both versions are compiled with the following settings: ./configure --prefix=/usr --localstatedir=/var --libexecdir=/usr/lib --sysconfdir=/etc/dovecot --enable-ipv6 --with-rawlog --with-ssl=openssl --with-pop3d --with-mysql "make" runs cleanly. Then I use "checkinstall" intead of "make install" because I want to generate an rpm package, but that shouldn't make any difference. Im using the following packages from suse (since im building the server upon a SuSE 9.3): mysql-4.1.10a-3.2, mysql-devel-4.1.10a-3, mysql-client-4.1.10a-3 and mysql-shared-4.1.10a-3 I don't have any clue, why the connect fails. The password and the username are both correct (triple verified ;-)) and the user has SELECT- and USE- Permission for my_dbname. Is there any known bug i didn't know about? Or is this a typical PEBKAC situation? Thanks in advance, Michael -- www.megamimi.de.vu
Michael Gabb
2005-Aug-10 16:19 UTC
[Dovecot] Failed authentication to a mysql database (bug or PEBKAC?)
Hello, here's an update: it all works with version 0.99... But this version doesn't support shared folders and all my boss wants is shared folders and mysql. Anyone got an idea why the mysql connection fails? thanks, Michael Michael Gabb schrieb:> Hello, > > I'm trying to setup a mailserver running postfix and dovecot with mysql > as database backend. Postfix is already running and delivers mails just > fine. Unfortunately, dovecot has great problems connecting to the > database (using username + password). If I disable the password, > everthing works fine. But, thats harakiri, security wise ;-) > > I tried dovecot-1.0-stable and the latest cvs-nightly (I think from > August 9.). With both versions, I get the following error (there are > little differences between the to versions, but the meaning ist the same...) > > dovecot: auth-worker(default): mysql: Connect failed to localhost > (my_dbname): Access denied for user 'my_user'@'localhost' (using > password: YES) - waiting for 1 seconds before retry > > My connect string is as follows: > connect = host=/var/lib/mysql/mysql.sock user=my_user > password=my_password dbname=my_dbname > > Both versions are compiled with the following settings: > ./configure --prefix=/usr --localstatedir=/var --libexecdir=/usr/lib > --sysconfdir=/etc/dovecot --enable-ipv6 --with-rawlog --with-ssl=openssl > --with-pop3d --with-mysql > > "make" runs cleanly. Then I use "checkinstall" intead of "make install" > because I want to generate an rpm package, but that shouldn't make any > difference. > > Im using the following packages from suse (since im building the server > upon a SuSE 9.3): mysql-4.1.10a-3.2, mysql-devel-4.1.10a-3, > mysql-client-4.1.10a-3 and mysql-shared-4.1.10a-3 > > I don't have any clue, why the connect fails. The password and the > username are both correct (triple verified ;-)) and the user has SELECT- > and USE- Permission for my_dbname. > > Is there any known bug i didn't know about? Or is this a typical PEBKAC > situation? > > Thanks in advance, > Michael > >-- www.megamimi.de.vu
Timo Sirainen
2005-Aug-14 19:42 UTC
[Dovecot] Failed authentication to a mysql database (bug or PEBKAC?)
On Tue, 2005-08-09 at 11:20 +0200, Michael Gabb wrote:> My connect string is as follows: > connect = host=/var/lib/mysql/mysql.sock user=my_user > password=my_password dbname=my_dbnameThis should work. Assuming of course that it's all in one line. Hmm. Are you sure that all the spaces in the line are actually spaces and not just something that look like spaces? Maybe check with strace if it's actually sending the password to mysql? Something like: strace -o log -f dovecot -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20050814/0903c6cc/attachment.bin>
jigen
2005-Aug-15 23:27 UTC
[Dovecot] Failed authentication to a mysql database (bug or PEBKAC?)
Hi, There is same problem on OpenBSD3.7 and NetBSD2.0.2, dovecot 1.0.test80. With dovecot0.99.14 all works well. Here is a ktrace on obsd: http://jigen.indivia.net/kdump.text tnx, bye -- .jigen
g.visschers at sr-solutions.nl
2005-Aug-18 11:00 UTC
[Dovecot] Failed authentication to a mysql database (bug or PEBKAC?)
Hello, I too got a problem with dovecot trying to login to MySQL. It connects fine without a password, when i add a password the sql server rejects the connection I know the problem, but don't know enough C++ to fix it. The exerpts from the mysql log are: without password: 050818 11:33:29 8 Connect dovecot at server2 on postfix with password: 050818 11:45:19 12 Connect Access denied for user 'dovecot'@'server2' (using password: YES) As soon as i add a password to the connet string some "'" appear around the username and hostname, which makes the username invalid. Ger Visschers. PS: I'm using dovecot-stable 20050817
jigen
2005-Aug-19 14:56 UTC
[Dovecot] Failed authentication to a mysql database (bug or PEBKAC?)
Hi, dovecot has a little crazy behaviour connecting to a mysql db: if you specify "127.0.0.1" as host instead of "localhost" it seems to work, also with a password. BUT, if you assign host=localhost without a password, it works too (as Ger Visschers says).... One more question: how I can specify more different mysql-db conteining different users? I try in the following way: passdb sql { args = /etc/dovecot/dovecot-mysql_django.conf args = /etc/dovecot/dovecot-mysql_debord.conf } and also: passdb sql { args = /etc/dovecot/dovecot-mysql_debord.conf } passdb sql { args = /etc/dovecot/dovecot-mysql_django.conf } but it always seems to remember only the last args value and it tries to connect only one db... bye jigen -- jigen <jigen at metalabs.org> MeTA~LAbS
Alexander Sabourenkov
2005-Oct-19 20:25 UTC
[Dovecot] Failed authentication to a mysql database (bug or PEBKAC?)
jigen wrote:> Hi, > dovecot has a little crazy behaviour connecting to a mysql db: if you > specify "127.0.0.1" as host instead of "localhost" it seems to work, > also with a password. BUT, if you assign host=localhost without a > password, it works too (as Ger Visschers says).... >Got the same problem with alpha3 and mysql-4.1.14 on FreeBSD-5.4R/i386. (both installed from ports) Does not work in any combination with password. Does work without password. Noticed weird client hostnames reported by the mysql server in the dovecot logs (messages from libmysqlclient). Seems like it wrongfully computes the client hostname, and the authentication fails becauese of that. Is there some kind of initialization in the libmysqlclient? -- ./lxnt