Gmail 以及本地 ISP 为 Exim 电子邮件传递 DKIM ,但 Microsoft 没有,标题中注明了失败:
Authentication-Results: spf=pass (sender IP is [correct IP]) smtp.mailfrom=[correct domain].co.uk; outlook.com; dkim=fail (signature did not verify) header.d=[correct domain];outlook.com; dmarc=bestguesspass action=none header.from=[correct domain];
我尝试过的:
我通过 Google Apps (G Suite) 电子邮件(使用不同的 DKIM 选择器,即另一个 DNS TXT 记录中的另一个公钥)从同一域向 Outlook 发送了一封电子邮件,以比较消息来源 - Google 的消息通过了 DKIM。
我注意到两件事:
我还注意到,除了“h”中的差异之外,DKIM-Signature header 结构在两个栏中完全相同,但有一些空白差异(exim 在分号分隔符之后也只有空格和换行符,因此看起来没问题,只是分解方式不同)。起初我想也许 Exim 没有设置一些必需的标签,但在这种情况下,错误应该是不同的。
import/export 版本:4.87
在 cPanel 11 centOS 7.2 服务器上运行
import/export DKIM 配置:
dkim_remote_smtp:
driver = smtp
interface = <; ${if exists {/etc/mailips}{${lookup{${lc:$sender_address_domain}}lsearch{/etc/maili
ps}{$value}{${lookup{${lc:$sender_address_domain}}lsearch{/etc/mailips}{$value}{${lookup{${perl{get_
sender_from_uid}}}lsearch*{/etc/mailips}{$value}{}}}}}}}}
helo_data = ${if exists {/etc/mailhelo}{${lookup{${lc:$sender_address_domain}}lsearch{/etc/mailhel
o}{$value}{${lookup{${lc:$sender_address_domain}}lsearch{/etc/mailhelo}{$value}{${lookup{${perl{get_
sender_from_uid}}}lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}}}}}{$primary_hostname}}
dkim_domain = ${lc:$sender_address_domain}
dkim_selector = default
dkim_private_key = "/var/cpanel/domain_keys/private/${dkim_domain}"
dkim_canon = relaxed
dkim_sign_headers = to:from:subject:message-id:date:user-agent:mime-version:content-transfer-encoding
(最后一行是我添加的 - 它之前也不起作用)
由于该错误似乎与签名验证特别相关,因此我认为以下内容无关紧要,但无论如何我都将其包含在内:
Exim 电子邮件由服务器上的 Mr nobody 发送,但信封来自和返回路径 header 是预期发件人的正确电子邮件地址。这方面不应该有任何问题,因为 SPF,即使在 MS 上,也在通过。
虽然从谷歌发送的电子邮件有
Message-ID: <[id]@[domain of sender]>
Exim 发送的电子邮件有
Message-ID: <[id]@[server host name]>
任何帮助/想法将不胜感激。和往常一样,MS 让生活变得困难......有趣吗?
最佳答案
哇那太幸运了!在发布之前绝望地搜索 Exim 的用户邮件列表时,我很有可能找到了答案。我打开的其中一条公告消息也发布到了 exim-dev,因此在底部存档查看器显示了此邮件列表中的上一条消息,这恰好是关于一个已解决的旧 DKIM 错误“dkim_sign_headers 中包含的标题是不在消息中时不在签名中”。
但是,这让我想到了从 dkim_sign_headers 中排除不在我的 Exim 生成的电子邮件中的标题......它起作用了:)
dkim=pass (signature was verified)
似乎 DKIM 签名应该使用在“h”标签中指定的不存在的 header 来计算,以使签名在随后添加到电子邮件中时失败(具有一定的安全意义),所以我的猜测是 MS搞砸了计算,但我不确定。
关于email - Exim 的 DKIM 签名不会在 Microsoft 服务器(outlook、hotmail)上验证*仅*,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40384797/