【问题标题】:Exim (Dovecot authenticator) malformed sender address: "user@domain"@domain (should be: user@domain) [closed]Exim(Dovecot 身份验证器)格式错误的发件人地址:“user@domain”@domain(应为:user@domain)[关闭]
【发布时间】:2014-10-30 14:00:25
【问题描述】:

我正在使用 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 中编写一个重写规则来修复传出的邮件标头,但我宁愿找到问题的根源。有什么建议吗?

【问题讨论】:

    标签: smtp exim dovecot


    【解决方案1】:

    【讨论】:

    • 谢谢托德!那成功了。我保证在发布问题之前我做了一些搜索......猜想有不同的措辞方式。 ;)
    猜你喜欢
    • 2012-08-01
    • 2015-04-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-21
    • 2017-06-10
    相关资源
    最近更新 更多