[Dovecot] problems connecting to the Problems connecting to mysql
Hi,
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).
Found that two threads about the same issue but none of them solves the problem
http://dovecot.org/list/dovecot/2005-April/006770.html http://dovecot.org/list/dovecot/2005-August/008394.html
I am using: dovecot-1.0.alpha5 mysql 5.0.17-1
Please, can anyone help? Thanks in advance,
Alfonso
On Fri, 2005-12-30 at 20:30 +0100, Alfonso Fernández Vázquez wrote:
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).
Thanks Timo, everything works fine for me now.
But I'm not sure this is true: "MySQL changed PASSWORD() format on 4.1 server but it seems that C
API library still uses old password format"
because the little program below connects to the database using the new PASSWORD() format. So I think it has to be something related to dovecot itself.
#include <mysql.h> #include <stdio.h>
int main() { MYSQL mysql; mysql_init(&mysql); if (mysql_real_connect(&mysql,"localhost","postfixuser","xxxxxx","postfix",0,NULL,0) == NULL) fprintf(stderr, "Failed to connect to database: Error: %s\n", mysql_error(&mysql)); else fprintf(stderr, "Connected to database\n"); }
gcc p.c -I/usr/include/mysql -lmysqlclient
Timo Sirainen escribió:
On Fri, 2005-12-30 at 20:30 +0100, Alfonso Fernández Vázquez wrote:
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).
let me guess... the error is that mysql server has gone away? if this is the case, i solved this issue with .99 and if the reconnect method is the same in 1.0-alphaX then take a look at the mysql connection variable (it has a bit "connected") and then look at the dovecot mysql connection function in db-mysql*c
there's a patch I posted earlier.
Alfonso Fernandez wrote:
Thanks Timo, everything works fine for me now.
But I'm not sure this is true: "MySQL changed PASSWORD() format on 4.1 server but it seems that C
API library still uses old password format"
because the little program below connects to the database using the new PASSWORD() format. So I think it has to be something related to dovecot itself.
#include <mysql.h> #include <stdio.h>
int main() { MYSQL mysql; mysql_init(&mysql); if (mysql_real_connect(&mysql,"localhost","postfixuser","xxxxxx","postfix",0,NULL,0) == NULL) fprintf(stderr, "Failed to connect to database: Error: %s\n", mysql_error(&mysql)); else fprintf(stderr, "Connected to database\n"); }
gcc p.c -I/usr/include/mysql -lmysqlclient
Timo Sirainen escribió:
On Fri, 2005-12-30 at 20:30 +0100, Alfonso Fernández Vázquez wrote:
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).
Adrian Vasile wrote:
let me guess... the error is that mysql server has gone away? if this is the case, i solved this issue with .99 and if the reconnect method is the same in 1.0-alphaX then take a look at the mysql connection variable (it has a bit "connected") and then look at the dovecot mysql connection function in db-mysql*c
there's a patch I posted earlier.
Alfonso Fernandez wrote:
Thanks Timo, everything works fine for me now.
But I'm not sure this is true: "MySQL changed PASSWORD() format on 4.1 server but it seems that C
API library still uses old password format"
because the little program below connects to the database using the new PASSWORD() format. So I think it has to be something related to dovecot itself.
#include <mysql.h> #include <stdio.h>
int main() { MYSQL mysql; mysql_init(&mysql); if (mysql_real_connect(&mysql,"localhost","postfixuser","xxxxxx","postfix",0,NULL,0) == NULL) fprintf(stderr, "Failed to connect to database: Error: %s\n", mysql_error(&mysql)); else fprintf(stderr, "Connected to database\n"); }
gcc p.c -I/usr/include/mysql -lmysqlclient
Timo Sirainen escribió:
On Fri, 2005-12-30 at 20:30 +0100, Alfonso Fernández Vázquez wrote:
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).
Hi -
You guessed wrong, I'm sorry.
The error is rather generic - again, only stating that "password authentication failed", no more, no less.
I did increase the maximum number of children and waiting processes for
Dovecot, and this actually seems to help. I suspect that "password
authentication failed" is a very generic error message used on purpose
because POP3 simply does not have any scope for more elaborate errors.
I think that if and when a new connection was made to the Dovecot
POP3/IMAP server, and it could not (for whatever reason) verify the
password, the generic error would be returned.
MySQL connections are minimal, and well above max_connections. Finding this out was my first task.
Thanks for your help and time -dant
participants (5)
-
Adrian Vasile
-
Alfonso Fernandez
-
Alfonso Fernández Vázquez
-
dan@ipws.com
-
Timo Sirainen