我正在使用 CentOS 6.5 / Exim 4.72 / Dovecot 2.0.9 运行邮件服务器,并且遇到以下问题:当我从 Thunderbird 发送电子邮件时,例如从地址 me@mydomain.com 发送电子邮件时,发送的内容如下标题(摘录):
Return-path: <"me@mydomain.com"@mydomain.com>
Envelope-to: me@mydomain.com
...
Received: from host86-128-154-245.range86-128.btcentralplus.com ([86.128.154.245] helo=asus-i7.banchory)
by mail.mydomain.com with esmtpsa (UNKNOWN:AES128-SHA:128)
(Exim 4.72)
(envelope-from <"me@mydomain.com"@mydomain.com>)
id 1Xjdoz-0005Zt-7M; Thu, 30 Oct 2014 01:42:37 +0100
Message-ID: <54518978.6010305@mydomain.com>
...
From: Kalenz <me@mydomain.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0
...
Sender: "me@mydomain.com"@mydomain.com
您可能会看到它做错了什么:它说它"me@mydomain.com"@mydomain.com
实际上应该说的任何地方me@mydomain.com
。我不知道它为什么这样做。
无论如何,大多数收件人都会接受这一点,但一些更保守的邮件主机会拒绝这些邮件。99% 的时间回复正常;有时他们引用我的原始信息来自:"me@mydomain.com"@mydomain.com On Behalf Of me@mydomain.com
。
我不认为它是 Thunderbird,因为这不是来自同一客户端的其他邮件服务器(即其他地址)的问题。
从 Exim 日志(相同的消息):
2014-10-30 01:42:37 1Xjdoz-0005Zt-7M <= "me@mydomain.com"@mydomain.com H=host86-128-154-245.range86-128.btcentralplus.com (asus-i7.banchory) [86.128.154.245] P=esmtpsa X=UNKNOWN:AES128-SHA:128 A=dovecot_plain:me@mydomain.com S=30908 id=54518978.6010305@mydomain.com
2014-10-30 01:42:38 1Xjdoz-0005Zt-7M => me <me@mydomain.com> R=dovecot_virtual_router T=dovecot_virtual_transport
2014-10-30 01:42:38 1Xjdoz-0005Zt-7M => otherguy@hisdomain.com <otherguy@hisdomain.com> R=dnslookup T=remote_smtp H=mail.hisdomain.com [12.34.56.78] X=TLSv1:DHE-RSA-AES256-SHA:256
2014-10-30 01:42:38 1Xjdoz-0005Zt-7M Completed
(第二行是给自己的密件抄送。)
如您所见,Exim 使用 Dovecot 身份验证器,并在日志文件中报告正确的用户名在A=dovecot_plain:me@mydomain.com
.
从 /etc/exim.conf:
# Host's fully qualified canonical name
primary_hostname = mail.mydomain.com
# Our own mail domains:
domainlist local_domains = @ : localhost : localhost.localdomain : mydomain.com : otherdomain.com
# The domain to add to all unqualified addresses (defaults to primary_hostname):
qualify_domain = mydomain.com
...
# Dovecot authenticators ref. http://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_dovecot_authenticator.html
dovecot_plain:
driver = dovecot
public_name = PLAIN
server_socket = /var/run/dovecot/auth-client
server_set_id = $auth1
exim.conf 中没有重写规则。
从 /etc/dovecot/conf.d/10-auth.conf 中的 Dovecot 配置:
# Default realm/domain to use if none was specified.
# This is used for both SASL realms and appending @domain to username in plaintext logins.
auth_default_realm = mydomain.com
# Space separated list of wanted authentication mechanisms:
# plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi otp skey gss-spnego
auth_mechanisms = plain
...
#!include auth-deny.conf.ext
#!include auth-master.conf.ext
#!include auth-system.conf.ext
#!include auth-sql.conf.ext
#!include auth-ldap.conf.ext
!include auth-passwdfile.conf.ext
#!include auth-checkpassword.conf.ext
#!include auth-vpopmail.conf.ext
#!include auth-static.conf.ext
我确实尝试过消隐auth_default_realm
,但这并没有帮助。
然后到 /etc/dovecot/conf.d/auth-passwdfile.conf.ext:
# cat auth-passwdfile.conf.ext
# Authentication for passwd-file users. Included from auth.conf.
# Note: if the user logs in as "billy@domain.com", then %u="billy@domain.com" and %n="billy".
passdb {
driver = passwd-file
args = username_format=%u /path/to/passdb
}
userdb {
driver = passwd-file
args = username_format=%u /path/to/passdb
}
该 passdb 文件中的条目如下所示:
me@mydomain.com:{SHA512-CRYPT}[~~~]:dovecot:mail::/srv/mail/mydomain.com/me::
(注意,我编辑了密码哈希,在[~~~]
。)
这就是我卡住的地方。我没有看到 Dovecot 做错了什么(无论如何,邮件接收和 POP/IMAP 工作正常),所以我怀疑我的 Exim 配置有错误。
我想我可以在 Exim 中编写一个重写规则来修复传出的邮件标题,但我宁愿找到问题的根源。有什么建议吗?