Dovecotlogin失败的虚拟用户(权限被拒绝,我们不在5000组)

我有:

  • Ubuntu 17.04
  • 鸽舍2.2.27(c0f36b0)
  • 后缀3.1.4
  • 定期的unix用户在邮件/ home / bob / Maildir
  • 在/var/mail/vhosts/domain.com/bob/Maildir中使用邮件的虚拟用户

普通用户可以按预期接收邮件。 当虚拟用户尝试login时,失败。 日志显示这样的错误:

2017-09-14 22:44:55 auth: Error: passwd-file(travler at travler.net,54.210.254.169,<EYwzYDFZWoY20v6p>): stat(/var/mail/vhosts/travler.net/shadow) failed: Permission denied (euid=114(dovecot) egid=121(dovecot) missing +x perm: /var/mail/vhosts, we're not in group 5000(vmail), dir owned by 5000:5000 mode=0750) 

以前的用户在2015年有类似的问题: https : //dovecot.org/list/dovecot/2015-July/101469.html

他被build议看看https://wiki2.dovecot.org/UserIds …没有给出更具体的build议。 我看了看页面。 我试着添加mail_uidmail_gid 。 没有运气。

就我而言,我看到:

 # sudo -u dovecot groups dovecot vmail # sudo -u dovecot cat /var/mail/vhosts/travler.net/shadow <file contents> 

我有一个vmail用户:

 # id vmail uid=5000(vmail) gid=5000(vmail) groups=5000(vmail) # ls -la /var/mail/vhosts total 0 drwxr-s--- 1 vmail vmail 246 Jun 30 11:23 . drwxrwsrwt 1 mail mail 26 Dec 5 2016 .. drwxr-s--- 1 vmail vmail 66 Sep 14 23:11 travler.net # ls -l /var/mail/vhosts/travler.net/ total 8 -rw-r----- 1 vmail vmail 174 Dec 5 2016 passwd -rw-r----- 1 vmail vmail 173 Dec 5 2016 shadow drwxr-s--- 1 vmail vmail 450 Sep 9 13:16 travis.belmont drwxr-s--- 1 vmail vmail 750 Sep 13 14:14 travler 

我已经设置了mail_gid和mail_uid

 # doveconf -n|grep id mail_gid = 5000 mail_uid = 5000 

密码文件有这样的这一行:

 travler::5000:5000::/var/mail/vhosts/travler.net/travler::userdb_mail=maildir:~ 

这是我的完整configuration:

 # doveconf -n # 2.2.27 (c0f36b0): /etc/dovecot/dovecot.conf # Pigeonhole version 0.4.16 (fed8554) # OS: Linux 4.10.0-33-generic x86_64 Ubuntu 17.04 btrfs log_path = /var/log/dovecot log_timestamp = "%Y-%m-%d %H:%M:%S " mail_gid = 5000 mail_location = maildir:/home/%u/Maildir mail_privileged_group = mail mail_uid = 5000 namespace inbox { inbox = yes location = mailbox Drafts { special_use = \Drafts } mailbox Junk { special_use = \Junk } mailbox Sent { special_use = \Sent } mailbox "Sent Messages" { special_use = \Sent } mailbox Trash { special_use = \Trash } prefix = } passdb { driver = pam } passdb { args = username_format=%n /var/mail/vhosts/%d/shadow driver = passwd-file } plugin { sieve = file:~/sieve;active=~/.dovecot.sieve } protocols = " imap" service auth { unix_listener /var/spool/postfix/private/auth { mode = 0666 } } service imap-login { inet_listener imap { port = 0 } } ssl_cert = [snip] ssl_cipher_list = [snip] ssl_dh_parameters_length = 2048 ssl_key = # hidden, use -P to show it ssl_protocols = !SSLv3 !SSLv2 userdb { driver = passwd } userdb { args = username_format=%n /var/mail/vhosts/%d/passwd driver = passwd-file } 

我需要设置获得dovecot作为vmail运行/修复此错误?