📋 SPF Syntax Reference
Every SPF record is a TXT record beginning with v=spf1 followed by a sequence of mechanisms, modified by qualifiers, and optionally ended with a redirect or exp modifier. This reference covers every component of the SPF syntax defined in RFC 7208.
How an SPF Record Works
When a receiving server gets an email, it checks the sending IP against the sender domain's SPF record. Each mechanism is evaluated left to right. The first mechanism that matches determines the result. The qualifier on that mechanism determines whether it's a Pass, Fail, SoftFail, or Neutral outcome.
⚙️ Mechanisms
Mechanisms define which senders are authorised. They are evaluated left to right; the first match wins.
include
DNS lookup
a
DNS lookup
mx
DNS lookup
ip4
ip6
ptr
DNS lookup
exists
DNS lookup
all
🔀 Modifiers
Modifiers change how SPF evaluation works. They are processed after all mechanisms.
🎛️ Qualifiers
Qualifiers prefix mechanisms to control the outcome when a mechanism matches.
⚠️ The 10 DNS Lookup Limit
SPF allows a maximum of 10 DNS lookups per evaluation (RFC 7208 §4.6.4). Mechanisms that require DNS lookups are marked above. Exceeding 10 causes a permerror, which most receivers treat as a hard SPF failure. Use ip4: and ip6: where possible to stay under the limit.
🔧 Validate or Build Your SPF Record
Use these tools to check your current SPF record or build a new one from scratch.