[Dovecot] Problem with mysql...
Hello,
I am trying to run dovecot on my Linux. I am using an exim 3.30 as the MTA with vmail-sql virtual users.
I have installed latest dovecot release and ran through the config file. Some options seemed unclear to me, but generally I think it is OK.
The problem is, that MySQL authentication does not work. It even does not try to authenticate! Dovecot connects correctly with MySQL database, but then no activity is shown in MySQL logs - but when I try to login manually with the telnet, i get:
[root@mainframe root]# telnet localhost 143 Trying 127.0.0.1.143... Connected to localhost. Escape character is '^]'.
- OK dovecot ready. 1 login [my_email] [my_password] 1 NO Authentication failed.
Maybe I am doing something wrong? I have spent two days with this problem, even modifying source files could not help me localize the source of my troubles :(
Here are the important (I think) entries from /etc/dovecot/dovecot.conf:
# Authentication process name. auth = default
# Space separated list of wanted authentication mechanisms: # plain digest-md5 anonymous auth_mechanisms = plain
auth_userdb = mysql /etc/dovecot/dovecot-mysql.conf auth_passdb = mysql /etc/dovecot/dovecot-mysql.conf
Any suggestions?
Best regards,
Jacek Osiecki joshua@ceti.pl Poland
On 6.9.2004, at 11:04, Jacek Osiecki wrote:
The problem is, that MySQL authentication does not work. It even does not try to authenticate! Dovecot connects correctly with MySQL database, but then no activity is shown in MySQL logs - but when I try to login manually with the telnet, i get:
Try setting auth_verbose = yes, and with 0.99.11 even auth_debug = yes if it didn't help. Those should give enough information about the problem.
On Mon, 6 Sep 2004, Timo Sirainen wrote:
On 6.9.2004, at 11:04, Jacek Osiecki wrote:
The problem is, that MySQL authentication does not work. It even does not try to authenticate! Dovecot connects correctly with MySQL database, but then no activity is shown in MySQL logs - but when I try to login manually with the telnet, i get:
Try setting auth_verbose = yes, and with 0.99.11 even auth_debug = yes if it didn't help. Those should give enough information about the problem.
Thanks for help.
I have downloaded 0.99.11 for better debugging and enabled both options. However, it did not help: I am getting the "NO Authentication failed." answer, and the log files still give no further details:
dovecot: Sep 06 11:00:49 Info: Dovecot starting up dovecot-auth: Sep 06 11:00:50 Info: MySQL: connected to localhost dovecot-auth: Sep 06 11:00:50 Info: Login process 8 connected dovecot-auth: Sep 06 11:00:50 Info: Login process 9 connected dovecot-auth: Sep 06 11:00:50 Info: Login process 8 sent handshake: PID 6544 dovecot-auth: Sep 06 11:00:50 Info: Login process 9 sent handshake: PID 6545 dovecot-auth: Sep 06 11:00:50 Info: Login process 10 connected dovecot-auth: Sep 06 11:00:50 Info: Login process 10 sent handshake: PID 6547 imap-login: Sep 06 11:00:55 Info: Disconnected [127.0.0.1] dovecot-auth: Sep 06 11:00:55 Info: Login process 9 disconnected dovecot-auth: Sep 06 11:00:55 Info: Login process 9 connected dovecot-auth: Sep 06 11:00:55 Info: Login process 9 sent handshake: PID 6552
Still looking forward for help :)
Maybe someone could send me the conf file from working configuration, so I could check whether I have set something wrong?
Best regards,
Jacek Osiecki joshua@ceti.pl Poland
Jacek Osiecki wrote:
I have installed latest dovecot release and ran through the config file. Some options seemed unclear to me, but generally I think it is OK.
The problem is, that MySQL authentication does not work. [...] auth_userdb = mysql /etc/dovecot/dovecot-mysql.conf auth_passdb = mysql /etc/dovecot/dovecot-mysql.conf
In addition to what Timo suggested, I'd recommend first trying to get logins to work using more traditional user and password databases (i.e. /etc/passwd). Otherwise you end up debugging general configuration problems at the same time as SQL database configuration problems.
(My yet to be completed Dovecot-MySQL HOWTO will include this tip.)
-Tom
On Mon, 6 Sep 2004, Tom Metro wrote:
Jacek Osiecki wrote:
I have installed latest dovecot release and ran through the config file. Some options seemed unclear to me, but generally I think it is OK.
The problem is, that MySQL authentication does not work. [...] auth_userdb = mysql /etc/dovecot/dovecot-mysql.conf auth_passdb = mysql /etc/dovecot/dovecot-mysql.conf
In addition to what Timo suggested, I'd recommend first trying to get logins to work using more traditional user and password databases (i.e. /etc/passwd).
I have straced the dovecot daemon, and it seems that it tries to authenticate with use of pam. In following lines is the effect of my "investigation". Generally, for me it seems that there is something wrong with my mysql settings in main dovecot configuration file rather than in general issues. Maybe someone with working dovecot+mysql configuration could send me his main configuration file? I would be grateful...
I have traced three processes:
- 32580, seems to be the main imap login process,
- 32577, seems to be authenticating process
- 32589, sub-process that uses probably PAM to authenticate:
First - strace of main process (32580): it reads the LOGIN data from input (line 1), sends it to authenticating process (line 2), receives answer (line 3) which tells him to say "authentication failed" (line 4).
1 read(6, "1 login joshua@xxxxx yyyy"..., 512) = 37 2 write(8, "\0joshua@xxxxx\0yyyy", 28) = 28 3 read(8, "\1\0\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 4068) = 20 4 write(6, "1 NO Authentication failed.", 27) = 27
Then main authenticating process (32577): it reads the LOGIN data from the main process (line 1), forks into process 32589 (line 2) and then sends the "login failed" to main process (line 3).
1 read(7, "\2\0\0\0\1\0\0\0\34\0\0\0\0joshua@xxxxx\0yy"..., 4076) = 40 2 fork() = 32589 3 write(7, "\1\0\0\0\3\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 20) = 20
Finally, here is the trace of the forked process. It seems that it deals only with PAM - and even does not try to use mysql...
close(10) = 0 stat("/etc/pam.d", {st_mode=S_IFDIR|0755, st_size=378, ...}) = 0 open("/etc/pam.d/dovecot", O_RDONLY) = -1 ENOENT (No such file or directory) open("/etc/pam.d/other", O_RDONLY) = 10 fstat(10, {st_mode=S_IFREG|0644, st_size=210, ...}) = 0 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x128000 read(10, "#%PAM-1.0\nauth required "..., 4096) = 210 open("/lib/security/pam_deny.so", O_RDONLY) = 12 read(12, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\300\6\0"..., 1024) = 1024 fstat(12, {st_mode=S_IFREG|0755, st_size=3560, ...}) = 0 old_mmap(NULL, 6560, PROT_READ|PROT_EXEC, MAP_PRIVATE, 12, 0) = 0x3e6000 mprotect(0x3e7000, 2464, PROT_NONE) = 0 old_mmap(0x3e7000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 12, 0) = 0x3e7000 close(12) = 0 read(10, "", 4096) = 0 close(10) = 0 munmap(0x128000, 4096) = 0 time(NULL) = 1094538610 munmap(0x3e6000, 6560) = 0 write(11, "\0\0\0\0", 4) = 4 _exit(0) = ?
Best regards,
Jacek Osiecki joshua@ceti.pl Poland
On 7.9.2004, at 09:54, Jacek Osiecki wrote:
auth_userdb = mysql /etc/dovecot/dovecot-mysql.conf auth_passdb = mysql /etc/dovecot/dovecot-mysql.conf
I have straced the dovecot daemon, and it seems that it tries to authenticate with use of pam.
Well, two possibilities then:
you're modifying wrong config file
you're modifying wrong auth section in config file. Do you have multiple "auth = xyz" lines in the conf file? (which also means there are multiple dovecot-auth processes running)
On Tue, 7 Sep 2004, Timo Sirainen wrote:
On 7.9.2004, at 09:54, Jacek Osiecki wrote:
auth_userdb = mysql /etc/dovecot/dovecot-mysql.conf auth_passdb = mysql /etc/dovecot/dovecot-mysql.conf
I have straced the dovecot daemon, and it seems that it tries to authenticate with use of pam.
Well, two possibilities then:
- you're modifying wrong auth section in config file. Do you have multiple "auth = xyz" lines in the conf file? (which also means there are multiple dovecot-auth processes running)
Oh my... :) That was it! I had a single "auth = plain_md5" line at the end of the config file - when I removed it, everything worked!
Good to have finally an IMAP service - ready for the webmail :)
Thanks and Greetings,
Jacek Osiecki joshua@ceti.pl Poland
participants (3)
-
Jacek Osiecki
-
Timo Sirainen
-
Tom Metro