使用 REDIRECT 和 INCLUDE 的 SPF 记录

SPF record with REDIRECT and INCLUDE

所以我必须为共享域创建一个 SPF 记录 - 2 个邮件系统,一个是 Office 365。通常它看起来像这样:

“v=spf1 mx include:MAIL_SERVER include:spf.protection.outlook.com ~all”

很简单,如果事先配置成这样:

“v=spf1 mx include:MAIL_SERVER ~all"

但是我的情况不一样,是这样的:

“v=spf1 mx redirect:_spf.PROVIDERSERVER.COM"

我不确定,我可以这样做:

“v=spf1 mx redirect:_spf.PROVIDERSERVER.COM include:spf.protection.outlook.com ~all”

会这样吗?如果不是,那应该改什么?

我不确定这一点,但可以猜测一下! The docsredirect 完全替换了当前记录,所以我希望它忽略所有其他子句 - 但它也是从左到右计算的,所以也许它会进行 mx 查找首先 - 你可以手动测试它。

我不确定你为什么首先要看 redirect

我怀疑您可以通过以下方式实现您的目标:

"v=spf1 mx include:_spf.PROVIDERSERVER.COM include:spf.protection.outlook.com ~all"

据我所知(/理解https://www.rfc-editor.org/rfc/rfc7208#page-26)你可以做最后一个例子的记录。如果其他一切都失败了,将使用 redirect 修饰符,这意味着它将是最后检查的东西)。

请注意,根据同一个 RFC,建议将 redirect 修饰符放在记录的末尾,在 ~all.

之前

重定向是一个修改器而不是机制,并且只会被考虑在测试完所有其他 机制 之后。与 include 不同,一旦 redirect 被导航,它就不会 return 评估进一步的条款,虽然你的定位不是为清楚起见,它应该作为记录中的最后一个术语出现,因为只有在所有其他术语都经过测试并通过后才会对其进行评估。即它在 SPF 记录中的位置不会决定它的处理顺序。

如果记录中满足任何替代机制项,则处理将在该项和 return 评估条件处停止,这包括可能存在的任何 all 机制。因此,您不能将 redirectall 结合使用,因为 all 机制将始终被测试和满足首先,redirect 永远不会被处理。当然,重定向域的 SPF 中的任何 all 机制在达到时仍然适用,这与 include[ 中的 -all 不同。 =38=] 这将被 returning 不匹配 忽略到包含机制调用。 (警告:如果在遍历的 include 中遇到 +all 它将 return matched, 并触发包含在前面的任何结果,通常是默认的 + 。)

值得注意的是,任何重定向域自己的 SPF 都可能包含进一步的重定向,并且它们会按预期进行级联。但是,每个 重定向 都计入 查找计数 限制。

所以总而言之,你会想使用类似...

“v=spf1 mx include:spf.protection.outlook.com redirect:_spf.PROVIDERSERVER.COM”

为之前的答案添加一个插件。

RFC, section 6.1 on the redirect modifier 中读取:

This facility is intended for use by organizations that wish to apply the same record to multiple domains. For example:

 la.example.com. TXT "v=spf1 redirect=_spf.example.com"
 ny.example.com. TXT "v=spf1 redirect=_spf.example.com"
 sf.example.com. TXT "v=spf1 redirect=_spf.example.com"    
_spf.example.com. TXT "v=spf1 mx:example.com -all"

In this example, mail from any of the three domains is described by the same record. This can be an administrative advantage.

Note: In general, the domain "A" cannot reliably use a redirect to another domain "B" not under the same administrative control. Since
the stays the same, there is no guarantee that the record at domain "B" will correctly work for mailboxes in domain "A",
especially if domain "B" uses mechanisms involving local-parts. An
"include" directive will generally be more appropriate.

并且,redirect 修饰符不得与 all 机制结合使用:

For clarity, any "redirect" modifier SHOULD appear as the very last
term in a record. Any "redirect" modifier MUST be ignored if there
is an "all" mechanism anywhere in the record.

考虑到所有这些,我建议使用@Synchro 提供的语法。虽然这并不违反规则,但将机制与 redirect 修饰符结合起来是非常不寻常的。