【发布时间】:2015-12-25 02:22:42
【问题描述】:
问题
Dovecot 没有像我预期的那样使用mail_location。
我想为 LDAP 目录中的用户提供电子邮件服务。 用户帐户是存储在 LDAP 中的虚拟帐户,它们不映射到本地用户。
详情
软件包版本
OS Debian GNU/Linux 8.2 (jessie)
dovecot-core 1:2.2.13-12~deb8u1
dovecot-imapd 1:2.2.13-12~deb8u1
dovecot-ldap 1:2.2.13-12~deb8u1
squirrelmail 2:1.4.23~svn20120406-2
postfix 2.11.3-1
apache2 2.4.10-10+deb8u3
配置详情
我设置在/etc/dovecot/conf.d/10-mail.conf:
mail_location = maildir:/var/mail/vhosts/%d/%n
所以我希望邮件地址在/var/mail/vhosts/mydomain.com/myuser 为myuser@mydomain.com。
dovecot -n 命令抛出的一些鸽舍设置是:
mail_location = maildir:/var/mail/vhosts/%d/%n
mail_privileged_group = mail
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 =
}
protocols = " imap lmtp sieve"
service auth-worker {
user = vmail
}
service imap-login {
inet_listener imap {
port = 143
}
}
service lmtp {
unix_listener /var/spool/postfix/private/dovecot-lmtp {
group = postfix
mode = 0600
user = postfix
}
}
userdb {
args = /etc/dovecot/dovecot-ldap.conf.ext
driver = ldap
}
使用tail -f 命令查看/var/log/mail.log,它会抛出:
Sep 27 19:10:48 balam dovecot: imap-login: Login: user=<myuser>, method=PLAIN, rip=::1, lip=::1, mpid=24907, secured, session=<7/umVr8gvwAAAAAAAAAAAAAAAAAAAAAB>
Sep 27 19:10:48 balam dovecot: imap(myuser): Error: user myuser: Initialization failed: Namespace '': mkdir(/var/mail/vhosts//myuser) failed: Permission denied (euid=30000(myuser) egid=30002(IT) missing +w perm: /var/mail/vhosts/, dir owned by 5000:5000 mode=0755)
Sep 27 19:10:48 balam dovecot: imap(myuser): Error: Invalid user settings. Refer to server log for more information.
它正在尝试在/var/mail/vhosts//myuser 创建邮件目录,而不是我想要和期望的/var/mail/vhosts/mydomain.com/myuser。
如果您需要更多详细信息,请询问我!
测试
为了测试登录,我安装了一个 SquirrelMail 客户端,它会触发之前登录 /var/log/mail.log 的事件。
【问题讨论】:
-
也许this tutorial will help 我用它来构建我自己的多域电子邮件服务器,没有任何问题。我认为您可以找到错误的地方,因为站点中描述的配置与您的相似
-
@samayo,本教程完全不同,因为配置文件从 CentOS 6 到 Debian 8 (jessie) 不同。
标签: php email imap vhosts dovecot