我使用CentOS 6.5/Exim 4.72/Dovecot 2.0.9運行郵件服務器,並且具有以下問題:當我發送郵件,雷鳥,從地址[email protected]說,電子郵件與下列頭(摘錄)交付:Exim(Dovecot身份驗證器)格式錯誤的發件人地址:「user @ domain」@domain(應該是:user @ domain)
Return-path: <"[email protected]"@mydomain.com>
Envelope-to: [email protected]
...
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 <"[email protected]"@mydomain.com>)
id 1Xjdoz-0005Zt-7M; Thu, 30 Oct 2014 01:42:37 +0100
Message-ID: <[email protected]>
...
From: Kalenz <[email protected]>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0
...
Sender: "[email protected]"@mydomain.com
你或許可以看到它在做什麼錯誤的:它無處不在說"[email protected]"@mydomain.com
它實際上應該是說[email protected]
。我不知道它爲什麼這樣做。
無論如何,大多數收件人都會接受這個,但是一些更保守的郵件主機會拒絕這些郵件。回覆確定99%的時間;有時他們會引用我原來的信息:"[email protected]"@mydomain.com On Behalf Of [email protected]
。
我不認爲它是雷鳥,因爲這不是來自同一個客戶端的其他郵件服務器(即其他地址)的問題。
從進出口日誌(同樣的信息):
2014-10-30 01:42:37 1Xjdoz-0005Zt-7M <= "[email protected]"@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:[email protected] S=30908 [email protected]
2014-10-30 01:42:38 1Xjdoz-0005Zt-7M => me <[email protected]> R=dovecot_virtual_router T=dovecot_virtual_transport
2014-10-30 01:42:38 1Xjdoz-0005Zt-7M => [email protected] <[email protected]> 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
(即第二行是一個BCC自我。)
正如你所看到的,進出口使用Dovecot的認證,並在日誌文件在A=dovecot_plain:[email protected]
報告正確的用戶名。
從/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沒有重寫規則。
從Dovecot設定在/etc/dovecot/conf.d/10-auth.conf:
# 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 "[email protected]", then %u="[email protected]" 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文件看起來像這樣
和條目:
[email protected]:{SHA512-CRYPT}[~~~]:dovecot:mail::/srv/mail/mydomain.com/me::
(NB,我編輯了密碼哈希,在[~~~]
。)
而這就是我卡住的地方。我沒有看到Dovecot做錯了什麼(無論如何,郵件接收和POP/IMAP工作正常),所以我懷疑我的Exim配置有錯誤。
我想我可以在Exim中整理一個重寫規則來修復傳出的郵件頭,但我寧願找到問題的根源。有什麼建議?
感謝託德!那就是訣竅。我保證在發佈問題之前進行了一點搜索......猜測有不同的措辭。 ;) – Kalenz 2014-10-31 14:51:36