Gmail 拒绝向使用 550-5.7.26 的 Gmail 地址的收件人发送邮件

Gmail 拒绝向使用 550-5.7.26 的 Gmail 地址的收件人发送邮件

我有一个使用 postfix 的相当简单的电子邮件设置。我在家里运行 raspberry-pi,我的路由器将所有端口转发到该 raspberry-pi。我有一个可以查看传入邮件的 postfix 实例。我的电子邮件域 (hartley-consultants.com) 的 MX 记录指向此 (外部) ip 地址。虽然它很少更改,但它可能会被阻止发送邮件,因此我在云中的虚拟实例上拥有第二台服务器,它有自己的专用 ip 地址。这也运行 postfix,并且还有指向其 ip 地址的 hartley-consultants.com 的 MX 记录。我家实例的所有外发邮件都通过该云服务器路由。它已经以这种方式设置了很长时间 (至少 5 年)。

我的 hartley-consultants.com 的 DNS 服务器也有一个 TXT 记录,内容如下v=spf1 mx -all

大约一个月前,我突然开始收到这样的拒绝

This is the mail system at host asgard.hartley-consultants.com.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                   The mail system

<[email protected]>: host
    gmail-smtp-in.l.google.com[2a00:1450:400c:c1b::1a] said: 550-5.7.26 This
    message fails to pass SPF checks for an SPF record with a hard 550-5.7.26
    fail policy (-all). To best protect our users from spam and 550-5.7.26
    phishing, the message has been blocked. Please visit 550-5.7.26
    https://support.google.com/mail/answer/81126#authentication for more 550
    5.7.26 information. k13-20020a5d66cd000000b002185e450efbsi9129616wrw.664 -
    gsmtp (in reply to end of DATA command)

作为此邮件标题的一部分,postfix 添加的是

Reporting-MTA: dns; asgard.hartley-consultants.com
X-Postfix-Queue-ID: 68A463A2807
X-Postfix-Sender: rfc822; [email protected]
Arrival-Date: Mon, 13 Jun 2022 21:49:42 +0100 (BST)

Final-Recipient: rfc822; [email protected]
Original-Recipient: rfc822;[email protected]
Action: failed
Status: 5.7.26
Remote-MTA: dns; gmail-smtp-in.l.google.com
Diagnostic-Code: smtp; 550-5.7.26 This message fails to pass SPF checks for an
    SPF record with a hard 550-5.7.26 fail policy (-all). To best protect our
    users from spam and 550-5.7.26 phishing, the message has been blocked.
    Please visit 550-5.7.26
    https://support.google.com/mail/answer/81126#authentication for more 550
    5.7.26 information. k13-20020a5d66cd000000b002185e450efbsi9129616wrw.664 -
    gsmtp

由于我现在已经基本退休了,这个电子邮件域每个月只发送几封电子邮件,所以我需要修复它,但不是紧急修复。然而,我去了谷歌帮助,它没有告诉我我做错了什么

有人可以解释一下谷歌认为什么地方出了问题以及我需要做什么来解决这个问题吗?

答案1

我想,问题的答案可能在于此:

gmail-smtp-in.l.google.com[2a00:1450:400c:c1b::1a] said:

这表明您正在通过 IPv6 与 gmail 通信,但您的 MX 记录中的主机在 DNS 中仅有 IPv4 地址,因此您的 SPF 记录将覆盖所有这些地址,而 SPF 记录则遵循 MX 记录。

答案2

hartley-consultants.com 的 SPF 记录必须包含您发送电子邮件的主机的 IP 地址。

Google 抱怨您发送信息的 IP 地址未经授权。(我没有在您的问题中看到 IP 地址,因此无法验证。)

我正在查看您域名的 SPF 记录,发现有两个 IP 地址已获得授权:

$ spftrace hartley-consultants.com
hartley-consultants.com
│   "v=spf1 mx -all"
├── mx → hartley-consultants.com (lookups: 1/10, nested: 2/10)
│   ├── mail.hartley-consultants.com
│   │   └── 94.173.170.110
│   └── asgard.hartley-consultants.com
│       └── 213.138.108.48
│   not-match
└── all match result=fail
fail

确保将您发送邮件的 IP 地址包含在您的 SPF 策略中。例如,您可以将特定的 IPv4 地址添加到您当前的 SPF 策略中:"v=spf1 mx ip4:11.22.33.44 -all"

相关内容