大网数据广告活动
服务器运维问答

Allow mail to be sent from any subdomain (PTR, SPF, Gmail)

· 52CE 我爱测

I use a single smarthost as a hub to route all email from my network so that I can pass SPF checks on Gmail. However, although I always send through the same server, the From address can differ. For instance, a cron job on the se…

问题原文

原帖链接 · amoe · CC BY-SA 3.0

I use a single smarthost as a hub to route all email from my network so that I can pass SPF checks on Gmail. However, although I always send through the same server, the From address can differ. For instance, a cron job on the server dev.mydomain.com might generate the From address [email omitted]. I use /etc/aliases to redirect this cron email to my real email address. This email uses hosted Gmail, so the MX for mydomain.com points to Gmail's servers.

However, Gmail doesn't like these From addresses, probably because they don't exactly match the SPF record which is defined on mydomain.com. I receive the message that Our system has detected that this message does not meet IPv6 sending guidelines regarding PTR records and authentication.

I don't want to have to define separate SPF records that allow my one mail server to submit email for every single subdomain that I want to allow in the From address. Instead, I'd like to allow *@*.mydomain.com, as long as it is sent through the correct server.

2016-12-22 14:04:17 1cK3yj-0007Wz-4I <= [email omitted] H=(dev.mydomain.com) [2a01:7e00::f03c:91ff:fe79:81b] P=esmtp S=586 id=[email omitted]
2016-12-22 14:04:17 1cK3yj-0007Wz-4I ** [email omitted] 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

I am using Exim on Debian.

[Edit: It seems the cause was the reverse DNS/PTR record.]

已采纳解答

原帖链接 · Lars Lind Nilsson · CC BY-SA 3.0

Since the message from Google mentions PTR records, I think that perhaps the problem is not with SPF in this exact case, but instead caused by a missing PTR record for your server. If you check the URL mentioned in the message: https://support.google.com/mail/?p=IPv6AuthError under "Additional guidelines for IPv6", you should have a PTR record for your server (and a matching AAAA record pointing back to the same IP address). And if 2a01:7e00::f03c:91ff:febb:7422 is the IPv6 address of your server it does not have a PTR record.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-12-22)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。