允许从任何子域(PTR,SPF,Gmail)发送邮件

我使用单个智能主机作为集线器来路由来自我的networking的所有电子邮件,以便通过Gmail上的SPF检查。 不过,虽然我总是通过同一台服务器发送,但From地址可能不同。 例如,服务器dev.mydomain.com上的cron作业可能会生成发件人地址[email protected] 。 我使用/etc/aliases将此cron邮件redirect到我的真实电子邮件地址。 此电子邮件使用托pipe的Gmail,因此mydomain.com的MX指向Gmail的服务器。

不过,Gmail并不喜欢这些From地址,可能是因为它们并不完全符合mydomain.com上定义的SPFlogging。 我收到消息: Our system has detected that this message does not meet IPv6 sending guidelines regarding PTR records and authentication

我不想定义单独的SPFlogging,允许我的一个邮件服务器为我想要在From地址中允许的每个子域提交电子邮件。 相反,我想要允许*@*.mydomain.com ,只要它通过正确的服务器发送。

 2016-12-22 14:04:17 1cK3yj-0007Wz-4I <= [email protected] H=(dev.mydomain.com) [2a01:7e00::f03c:91ff:fe79:81b] P=esmtp S=586 [email protected] 2016-12-22 14:04:17 1cK3yj-0007Wz-4I ** [email protected] R=dnslookup T=remote_smtp X=TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128 DN="C=US,ST=California,L=Mountain View,O=Google Inc,CN=mx.google.com": SMTP error from remote mail server after end of data: host ASPMX.L.GOOGLE.com [2a00:1450:400c:c07::1a]: 550-5.7.1 [2a01:7e00::f03c:91ff:febb:7422] Our system has detected that this\n550-5.7.1 message does not meet IPv6 sending guidelines regarding PTR records\n550-5.7.1 and authentication. Please review\n550-5.7.1 https://support.google.com/mail/?p=IPv6AuthError for more information\n550 5.7.1 . p21si28305523wmb.29 - gsmtp 

我在Debian上使用Exim。

[编辑:这似乎是原因是反向的DNS / PTRlogging。]

由于谷歌的消息提到了PTRlogging,我认为或许这个问题不是SPF在这个确切的情况下,而是由你的服务器缺lessPTRlogging引起的。 如果您检查以下消息中提到的URL: https : //support.google.com/mail/?p= IPv6AuthError,请参阅“其他IPv6指导原则”,您应该为您的服务器提供PTRlogging(以及匹配的AAAAlogging指向回到相同的IP地址)。 如果2a01:7e00::f03c:91ff:febb:7422是你的服务器的IPv6地址,它没有PTRlogging。