DNS work and errors
04Evaluation is bounded so a policy cannot cause unlimited DNS-driven work.
EXPLORE ONE SPF DECISION · FICTIONAL EXAMPLES
What stops DNS-driven SPF work from growing forever?
Ten include terms fit the limit. In this fixture none authorizes the sender, so -all gives fail.
DNS
Nested domains hop1.example … hop10.exampleReturns the next policyFollow the nested policy chain
example.org: v=spf1 include:hop1.example -all- 1
include:hop1.exampleEvaluated · one slot - 2
include:hop2.exampleEvaluated · one slot - 3
include:hop3.exampleEvaluated · one slot - 4
include:hop4.exampleEvaluated · one slot - 5
include:hop5.exampleEvaluated · one slot - 6
include:hop6.exampleEvaluated · one slot - 7
include:hop7.exampleEvaluated · one slot - 8
include:hop8.exampleEvaluated · one slot - 9
include:hop9.exampleEvaluated · one slot - 10
include:hop10.exampleEvaluated · one slot
Each hop’s policy includes the next; the last policy is v=spf1 -all. All IPs and policies here are fictional.
For the ten-term case, the deepest -all returns fail. Each parent include then does not match, so its parent policy also reaches -all. Only an included pass would make include match.
Which terms count, and what else is limited?
include, a, mx, ptr and exists, plus redirect, share the ten-term limit. ip4, ip6 and all do not count. The initial SPF TXT lookup is not one of these terms. One term can cause several DNS queries: this is not a ten-packet limit.
MX and PTR processing have additional address-query limits. Void lookups should be limited to two by default; exceeding that limit produces permerror. These extra limits are outside this chain experiment. The ptr mechanism is not recommended.
Count evaluated DNS-causing terms across the entire recursion. A policy error is different from an unauthorized IP.
Exceeding the limit returns permerror instead of recursing forever.
Key idea: The total number of DNS-causing terms evaluated is limited to 10.
Rules & examples
The total number of DNS-causing terms evaluated is limited to 10.
- The total number of DNS-causing terms evaluated is limited to 10.
- Exceeding the limit produces permerror.
- Temporary DNS failures and permanent policy errors are different results; ip4 and ip6 do not consume this term limit.
Examples are illustrative. Consult the linked RFC and its errata for implementation details.
Sources
New to this? Start hereA quick picture + helpful background
The envelope and the letter do different jobs.
Mail transport moves a message between servers. The message format describes its contents. Authentication adds checks; it does not make every message safe.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.