在将Ubuntu从14.04升级到16.04之后,我不能再使用procmail中的dovecot交付程序作为根用户,因为它声称它不能打开auth-userdb文件,尽管普通用户可以,而imap服务器在其他情况下正常工作。
我清除和重新安装多维柯没有任何效果。文件权限似乎很好,但以根用户身份调用dovcot的传递失败,唯一被记录的错误(启用了所有dovecot调试标志)是:
%# cat /tmp/testmail | /usr/lib/dovecot/deliver -d username
Error 75
%# tail -n2 /var/log/dovecot.log
Error: userdb lookup: connect(/var/run/dovecot/auth-userdb) failed: Permission denied (euid=0(root) egid=8(mail) UNIX perms appear ok (ACL/MAC wrong?))
Aug 24 22:05:14 lda: Fatal: Internal error occurred. Refer to server log for more information.设置套接字上的文件权限,以便任何人都可以对其进行读/写。错误消息甚至说权限看起来很好。
%# ls -l /var/run/dovecot/auth-userdb
srwxrwxrwx 1 root mtagroup 0 Aug 24 00:47 /var/run/dovecot/auth-userdb=当以root用户的身份运行时,运行strace on交付显示在程序中止之前连接到套接字的失败,但是r/w权限随后会被测试,并且很好:
connect(7, {sa_family=AF_LOCAL, sun_path="/var/run/dovecot/auth-userdb"}, 110) = -1 EACCES (Permission denied)
close(7) = 0
...
stat("/var/run/dovecot", {st_mode=S_IFDIR|0755, st_size=740, ...}) = 0
getuid() = 0
geteuid() = 0
access("/var/run/dovecot", X_OK) = 0
getuid() = 0
geteuid() = 0
access("/var/run/dovecot/auth-userdb", R_OK) = 0
getuid() = 0
geteuid() = 0
access("/var/run/dovecot/auth-userdb", W_OK) = 0
geteuid() = 0
getegid() = 0
open("/etc/localtime", O_RDONLY|O_CLOEXEC) = 7
fstat(7, {st_mode=S_IFREG|0644, st_size=3585, ...}) = 0
fstat(7, {st_mode=S_IFREG|0644, st_size=3585, ...}) = 0
read(7, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7\0\0\0\7\0\0\0\0"..., 4096) = 3585
lseek(7, -2281, SEEK_CUR) = 1304
read(7, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\7\0\0\0\7\0\0\0\0"..., 4096) = 2281
close(7) = 0
write(6, "Aug 24 00:01:05 lda(cwolf): Erro"..., 180) = 180
stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3585, ...}) = 0
write(6, "Aug 24 00:01:05 lda: Fatal: Inte"..., 95) = 95
exit_group(75) = ?
+++ exited with 75 +++在syslog中没有有用的消息,而且所有的设备配置文件都处于抱怨模式。我可以使用一个小型perl程序以根用户身份连接到套接字。
Netstat显示套接字是活动的:
%# netstat -nvlap | fgrep auth-userdb
unix 2 [ ACC ] STREAM LISTENING 1874526 12031/auth [0 wait, /var/run/dovecot/auth-userdb由于套接字/文件权限看起来很好,而且套接字是活动的,所以我不知道如何更深入地调试它。有人想办法解决这个问题吗?
发布于 2016-08-25 08:30:14
Dovecot试图在用户的文件系统邮箱上使用用户的权限发送每封电子邮件。
这样,用户就可以通过IMAP、POP或webmail客户端阅读他们的电子邮件,而不必是根用户。
因此,在您的系统上传递的权限错误是dovecot试图将自己更改为用户的权限,以便在他们的文件夹上传递电子邮件。
为此,dovecot交付程序尝试从auth读取适当的权限。如果设置不正确,那么上面的msg就会失败。
PS:我确实认为以root用户的身份运行一切都是正确的方法。
https://serverfault.com/questions/798982
复制相似问题