centos – Dovecot创建文件夹,Postfix期望文件

前端之家收集整理的这篇文章主要介绍了centos – Dovecot创建文件夹,Postfix期望文件前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我尝试使用 this guide为虚拟用户配置Postfix / Dovecot组合.

我的服务器在CentOS 6.5上运行Postfix 2.6.6和Dovecot 2.0.9.

问题是当我使用Outlook 2013连接到服务器(它在IMAP SMTP上连接得很好)并向自己发送测试电子邮件时,我没有收到电子邮件.看着maillog我可以看到我收到了错误

postfix/virtual[2768]: 9C3D480768: to=<user@domain.net>,relay=virtual,delay=1132,delays=1132/0.02/0/0.02,dsn=4.2.0,status=deferred (delivery Failed to mailBox /var/vmail/domain.net/user: cannot open file: Is a directory)

错误消息非常清楚,我想,嗯,这可能是我之前安装的缺陷Cyrus / Postfix安装的剩余部分.我继续删除了vmail文件夹,为域创建了一个子文件夹,并将所有内容的所有权更改为vmail:vmail.我重新启动postfix和dovecot,再次出现收件箱目录. Postfix继续抱怨,就像之前做的那样.然后我尝试删除文件夹,然后创建一个空文件,但这只是一个dovecot问题,而不是一个后缀问题,所以现在dovecot说它期待一个文件而不是一个目录.

/etc/postfix/main.cf中

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/postfix/aliases
alias_database = $alias_maps

inet_interfaces = all
inet_protocols = ipv4
mydestination = $myhostname,localhost.$mydomain,localhost

debug_peer_level = 2
debugger_command =
         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
         ddd $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.6.6/samples
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES

relay_domains = *
virtual_alias_maps=hash:/etc/postfix/vmail_aliases
virtual_mailBox_domains=hash:/etc/postfix/vmail_domains
virtual_mailBox_maps=hash:/etc/postfix/vmail_mailBox

virtual_mailBox_base = /var/vmail
virtual_minimum_uid = 2222
virtual_transport = virtual
virtual_uid_maps = static:2222
virtual_gid_maps = static:2222

smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = /var/run/dovecot/auth-client
smtpd_sasl_security_options = noanonymous
smtpd_sasl_tls_security_options = $smtpd_sasl_security_options
smtpd_sasl_local_domain = $mydomain
broken_sasl_auth_clients = yes

smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks,reject_unauth_destination

/etc/dovecot/dovecot.conf

listen = *
ssl = no
protocols = imap lmtp
disable_plaintext_auth = no
auth_mechanisms = plain login
mail_access_groups = vmail
default_login_user = vmail
first_valid_uid = 2222
first_valid_gid = 2222
mail_location = maildir:/var/vmail/%d/%n

passdb {
    driver = passwd-file
    args = scheme=SHA1 /etc/dovecot/passwd
}
userdb {
    driver = static
    args = uid=2222 gid=2222 home=/var/vmail/%d/%n allow_all_users=yes
}
service auth {
    unix_listener auth-client {
        group = postfix
        mode = 0660
        user = postfix
    }
    user = root
}
service imap-login {
    process_min_avail = 1
    user = vmail
}

最后我的域/别名/邮箱列表中的一些示例条目

domain.tld        OK # /etc/postfix/vmail_domains
user@domain.tld   domain.tld/user # /etc/postfix/vmail_mailBox
user@domain.tld   user@domain.tld # /etc/postfix/vmail_aliases
user@domain.tld:oOeIaLM/TyEPOdflb+GlL7d1MhE= # /etc/dovecot/passwd
答案非常简单. / etc / postfix / vmail_mailBox中的路径缺少尾部斜杠.当没有尾部斜杠时,postfix会将其视为文件,从而假定邮箱采用MailBox(而非Maildir)格式.

通过附加尾部斜杠,postfix将正确地将目录视为maildir格式并相应地对其进行处理.

例:

user@domain.tld   domain.tld/user/
user2@domain.tld   domain.tld/user2/
原文链接:https://www.f2er.com/centos/373907.html

猜你在找的CentOS相关文章