在 dns 记录中设置 spf 的正确方法是什么?
我将其设置为: v=spf1 a mx ip4:xx.xxx.xx.xxx a -mx -all
是吗?
谢谢。
I'm setting it as: v=spf1 a mx ip4:xx.xxx.xx.xxx a -mx -all
it's right?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应如何配置 SPF 记录取决于您希望允许哪些服务器代表您发送电子邮件。但是,您的示例 SPF 记录包含一个矛盾。您同时指定
mx
和-mx
,这意味着如果 IP 与域的 MX 记录中找到的 IP 地址匹配,您希望同时通过和失败。您应该删除任何不适用的机制。在不知道您的确切需求的情况下,很难确切地说您应该使用什么 SPF 配置,但如果我必须在黑暗中进行尝试,我会说这可能是一个安全的选择:
这将传递来自您的域拥有的任何 IP 的电子邮件IP 地址 xx.xxx.xx.xxx 的
a
或mx
记录。它将使用?all
机制将neutral
状态应用于所有其他人。这使得垃圾邮件过滤器可以更自由地确定电子邮件的有效性,而不是硬失败 (-all
)。这里有一些我认为会对您有所帮助的资源。
SPF 机制解释
SPF 向导
How you should configure your SPF record depends on what servers you want to allow to send emails on your behalf. However, your example SPF record contains a contradition. You are specifying both
mx
and-mx
, meaning you want to both pass and fail if the IP matches an IP address found in the domain's MX records. You should remove whichever mechanism does not apply.Without knowing your exact needs it's hard to say exactly what SPF configuration you should use but if I had to take a shot in the dark I would say this is probably a safe bet:
This will pass an email originating form any IP that your domain has an
a
ormx
record for as well as IP address xx.xxx.xx.xxx. It will apply a status ofneutral
to all others using the?all
mechanism. This allows spam filters more latitude to determine the validity of the email as opposed to a hard fail (-all
).Here are a couple of resource that I think will help you.
SPF Mehanisms Explained
SPF Wizard