-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not silently use _spf.DOMAIN.EXT #10
Do not silently use _spf.DOMAIN.EXT #10
Comments
RFC7208 does in fact mention |
Could you point me to the exact location in RFC 7208 where they state to implicitly fallback to (or even to prefer) From my understanding, the authors of RFC 7208 just use the (indeed common) Instead, RFC 7208 specifically states that the SPF record has to be published at the exact owner name it belongs to. Specifically in section 3:
and later more explicitly in section 4.1:
and section 4.4:
Nowhere (according to my understanding) does RFC 7208 or any of its predecessors such as RFC 4408) specify to implicitly add the With that being said, it is indeed quite common to publish some parts of a final SPF policy on a hostname like
as a Again, if I'm wrong, I'm eager to revise my understanding of the RFCs here. I just have not found any mention of such an implicit fallback. In the case of Planio (the organisation sponsoring my initial pull request in #11), we publish our own primary SPF policy at With the current lookup rules in the spf-query gem, you would wrongly check |
I have the same experience @meineerde is describing with the domain |
Since f838afb, the gem prioritizes a query to
_spf.DOMAIN.EXT
instead of using a query to the requested domain itself. This produces invalid results in case a domain publishes SPF records on both_spf.DOMAIN.EXT
as well asDOMAIN.EXT
.In general, the only valid SPF record for a domain is in the TXT record of the domain itself. Nowhere in the spec (as far as I'm aware) does it specify that the
_spf.DOMAIN.EXT
record should be used in preference (or is even valid without explicit rules) rather than the record of the domain itself. Per the RFC, if_spf.DOMAIN.EXT
is to be used, it has to be referenced on the domain itself via e.g. aninclude
orredirect
rule.Thus, the automatic check for
_spf.#{domain}
inSPF::Query.query
should preferably be removed completely there since it produced incorrect results for some domain. It even contradicts the examples from the README.md for e.g.facebook.com
.If it is not possible to remove this check for any reason, it should at least be de-prioritized from the check of the passed domain itself and controlled via a flag.
I'd be happy to provide a pull request to remove or deprioritize this check for
_spf.DOMAIN.EXT
.The text was updated successfully, but these errors were encountered: