LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   dovecot-lda/postfix permission issues (https://www.linuxquestions.org/questions/linux-server-73/dovecot-lda-postfix-permission-issues-877397/)

deathclaw 04-27-2011 08:42 AM

dovecot-lda/postfix permission issues
 
I'm sooo exausted after two days of fooling with this.

The problem:
Apr 27 17:29:21 mxkasib dovecot: lda: Error: userdb lookup: connect(/var/run/dovecot/auth-userdb) failed: Permission denied (euid=8(mail) egid=12(mail) missing +w perm: /var/run/dovecot/auth-userdb, euid is not dir owner)

Obviously, dovecot-lda, instanced by postfix, couldn't access the auth-userdb file because of permission. There are plenty of topics over the internet, the problem is really simple. Except for I've got all the permissions needed, or it seems to me so and I'm missing something. Here is some additional information:

[root@mxkasib conf.d]# dovecot -n
# 2.0.11: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.18-238.9.1.el5 x86_64 CentOS release 5.6 (Final) ext3
listen = *
mail_location = maildir:/var/spool/mail/%n:INDEX=/var/spool/mail/.indexes/%n
mbox_write_locks = fcntl
passdb {
args = scheme=PLAIN username_format=%u /etc/dovecot/users
driver = passwd-file
}
protocols = pop3
service auth {
unix_listener auth-userdb {
group = mail
mode = 0666
user = mail
}
user = mail
}
service pop3-login {
inet_listener pop3 {
port = 110
}
}
ssl_cert = </etc/pki/dovecot/certs/dovecot.pem
ssl_key = </etc/pki/dovecot/private/dovecot.pem
userdb {
args = username_format=%u /etc/dovecot/users
driver = passwd-file
}

[root@mxkasib conf.d]# cat /etc/postfix/master.cf |tail -n 3
dovecot unix - n n - - pipe
flags=DRhu user=mail:mail argv=/usr/libexec/dovecot/dovecot-lda -f ${sender} -d ${recipient}

[root@mxkasib conf.d]# ls -l /var/run/dovecot/
srw------- 1 root root 0 Апр 27 17:29 anvil
srw------- 1 root root 0 Апр 27 17:29 anvil-auth-penalty
srw------- 1 root root 0 Апр 27 17:29 auth-client
srw------- 1 dovecot root 0 Апр 27 17:29 auth-login
srw------- 1 root root 0 Апр 27 17:29 auth-master
srw-rw-rw- 1 mail mail 0 Апр 27 17:29 auth-userdb
srw------- 1 dovecot root 0 Апр 27 17:29 auth-worker
srw------- 1 root root 0 Апр 27 17:29 config
srw------- 1 root root 0 Апр 27 17:29 dict
srw------- 1 root root 0 Апр 27 17:29 director-admin
srw------- 1 root root 0 Апр 27 17:29 director-userdb
srw-rw-rw- 1 root root 0 Апр 27 17:29 dns-client
srw------- 1 root root 0 Апр 27 17:29 doveadm-server
drwxr-xr-x 2 root root 4096 Мар 17 18:00 empty
srw-rw-rw- 1 root root 0 Апр 27 15:31 lmtp
drwxr-x--- 2 root dovenull 4096 Апр 27 17:29 login
-rw------- 1 root root 5 Апр 27 17:29 master.pid

Apparently, I've given all the permissions I could imagine. It's even devil 666, and it still complains. Please, mayday, cause I ran off with any possible ideas. Thanks in advance.

jadrevenge 04-27-2011 10:15 AM

it could be permissions on the directory /var/run/dovecot, rather than on that specific file ... especially if it is trying to create a lock file before reading/writing.

no guarantees though.

deathclaw 04-28-2011 06:42 AM

I gave up. It seems, that there is some kind of misunderstanding between dovecot 2.* and postfix 2.3 in these terms, cause the former is to 'young' and the latter is to 'old'. I'm not going to upgrade postfix, so I downgraded dovecot, and facing different kind of problems, but anyways, the topic is closed.

maliroc 06-22-2012 11:56 AM

mysql-dovecot-relay-error
 
Original error
tail -f /var/vmail/dovecot-delivery.log
lda: Error: userdb lookup: connect(/var/run/dovecot/auth-userdb) failed: Permission denied (euid=5000(vmail) egid=5000(vmail) missing +r perm: /var/run/dovecot/auth-userdb, euid is not dir owner)

tail -f /var/log/mail.log
Jun 22 07:22:28 cataflam postfix/master[865]: daemon started -- version 2.8.5, configuration /etc/postfix
Jun 22 07:22:28 cataflam postfix/qmgr[872]: AC306A166C: from=<root@cataflam.maliroc.lan>, size=347, nrcpt=1 (queue active)
Jun 22 07:22:29 cataflam postfix/pipe[897]: AC306A166C: to=<fbar@maliroc.lan>, relay=dovecot, delay=109498, delays=109498/0.27/0/0.39, dsn=4.3.0, status=deferred (temporary failure)

Solution
Hi all was getting the same errors took me 2 days to understand what it was saying to me but i finally solved it



if you do an ls -l /var/run/dovecot/auth-userdb you will seet that root is the owner and the premissions are srw-------- so vmail has not right to call or even use the

process
What i did was a chown -R vmail:vmail /var/run/dovecot/auth-userdb
I also did a chmod g+r /var/run/dovecot/auth-userdb
ls -l /var/run/dovecot/auth-userdb
srw----r-- 1 vmail vmail
my unix_listener auth-userdb {
mode = 600
{

protocol lda {
auth_socket_path = /var/run/dovecot/auth-userdb
log_path = /home/vmail/dovecot-deliver.log

that worked for me
1. havent restarted the dovecot service dont know if it will keep the settings.

tail -f /var/log/mail.log
Jun 22 08:32:28 cataflam postfix/qmgr[872]: AC306A166C: from=<root@cataflam.maliroc.lan>, size=347, nrcpt=1 (queue active)
Jun 22 08:32:28 cataflam postfix/pipe[2481]: AC306A166C: to=<fbar@maliroc.lan>, relay=dovecot, delay=113698, delays=113698/0.17/0/0.39, dsn=2.0.0, status=sent (delivered via

dovecot service)
Jun 22 08:32:28 cataflam postfix/qmgr[872]: AC306A166C: removed
Jun 22 08:50:45 cataflam dovecot: auth: mysql(127.0.0.1): Connected to database mailstore



tail -f /var/vmail/dovecot-deliver.log
Jun 22 07:37:11 lda(fbar@maliroc.lan): Info: msgid=<20120622123710.CCD44A23D3@cataflam.maliroc.lan>: saved mail to INBOX
Jun 22 07:50:06 lda(fbar@maliroc.lan): Info: msgid=unspecified: saved mail to INBOX


All times are GMT -5. The time now is 03:41 PM.