[Dovecot] Problem with mysql...

Jacek Osiecki joshua at hybrid.pl
Tue Sep 7 09:54:27 EEST 2004


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 at xxxxx yyyy"..., 512) = 37
2 write(8, "\0joshua at 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 at 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 at ceti.pl
Poland



More information about the dovecot mailing list