大家好,

我有一位客户,他在由 ioMart 托管的 VM ubuntu 服务器上有一个网站。

他们遇到的问题越来越多,尤其是 Gmail,当从 VM 服务器(domain1 = VM 服务器)上的网站发送电子邮件时。我正在使用 postfix 来帮助发送电子邮件。

我尝试向客户主 DNS(域 2)添加 SPF,其中包括域 1 和域 1 的 ip4 地址。

v=spf1 mx include:[domain1] include:spf.protection.outlook.com include:_spf.google.com ip4:nn.nn.nnn.nnn ~all

我还尝试使用 OpenDKIM 在服务器上创建 DKIM,但我怀疑我可能创建错误。我使用 Domain2 而不是 Domain1 创建了它。我无法访问 Domain1 的 DNS,我必须指示 ioMart 创建条目(额外费用)。[[[这可能回答了我的问题]]]

尽管我已经设置了 SPF 和 DKIM,但向 Gmail 发送电子邮件时仍然会失败,并出现以下错误(服务器上的 mail.log):

Your email has been blocked because the sender is unauthenticated. 550-5.7.26 Gmail requires all senders to authenticate with either SPF or DKIM. 550-5.7.26 550-5.7.26 Authentication results: 550-5.7.26 DKIM = did not pass 550-5.7.26 SPF [domain1] with ip: [nn.nn.nnn.nnn] = did 550-5.7.26 not pass 550-5.7.26 550-5.7.26 For instructions on setting up authentication

当向 M365 发送电子邮件时 – 该电子邮件确实到达,但其标题中包含以下内容:

Authentication-Results: spf=none (sender IP is nn.nn.nnn.nnn)
 smtp.mailfrom=[domain1]; dkim=fail (invalid public key)
 header.d=[domain2];dmarc=none action=none
 header.from=[domain1];compauth=pass reason=105
Received-SPF: None (protection.outlook.com: [domain1]
 does not designate permitted sender hosts)
Received: from [domain1] (nn.nn.nnn.nnn) by
 DB5-----B9D.mail.protection.outlook.com (nn.nnn.n.nnn) with Microsoft
 SMTP Server id 15.20.7918.13 via Frontend Transport;

我的问题:有没有办法可以使用 [domain2] DNS 来帮助电子邮件通过 Gmail 身份验证,或者我需要为此使用 [domain1]?


最佳答案
1

当您向电子邮件地址发送电子邮件时joe@example.comexample.com域名应该具有相关的 SPF 和 DKIM 条目。

执行此操作的邮件服务器的 DNS 名称并不直接相关。您确实需要在 SPF 记录中包含电子邮件服务器的 DNS 名称,以便其他电子邮件服务器知道哪些邮件服务器可以为该域发送电子邮件。

DKIM 的无效公钥错误可能意味着您输入的记录不正确。可能不存在完整的字符串,或者里面有多余的字符。