concept Domains & DNS
SPF email authentication
SPF (Sender Policy Framework) lets a receiving mail system evaluate whether an observed SMTP sending IP is authorized for a specific SMTP identity, commonly MAIL FROM or HELO.
What it means
SPF (Sender Policy Framework) lets a receiving mail system evaluate whether an observed SMTP sending IP is authorized for a specific SMTP identity, commonly MAIL FROM or HELO. It reads a published policy, typically in DNS TXT, and returns a result such as pass, fail, softfail, none, temperror or permerror. A discovered but nonmatching policy yields neutral; no discovered policy yields none. SPF does not directly authenticate the visible email From address; DMARC adds an alignment requirement for that different identity.
Try it
Simulation — evaluate a bounded SPF rule. Use v=spf1 ip4:192.0.2.0/24 -all with 192.0.2.7: the ip4 rule passes. Change the IP to 198.51.100.7: -all fails. Replace -all with ~all for a softfail. Select duplicate SPF records, no record or temporary DNS error to see three distinct results. Invalid IP/prefix and unsupported mechanisms are rejected. Reset returns to the first synthetic sender.
Evaluate bounded SPF
Choose MAIL FROM identity and sender IP; inspect which supported SPF term matches.
First matched ip4 mechanism permits this MAIL FROM identity and IP, not the visible author or inbox delivery.
| Observation | Model value |
|---|---|
| SMTP identity | bounce.example.com |
| Sender IP | 192.0.2.7 |
| Policy | v=spf1 ip4:192.0.2.0/24 -all |
| DNS fixture | normal |
| Verdict | pass |
Local, bounded educational fixture. No DNS, mail, certificate, network, socket or external request is performed.
About this model
Supports only ip4 and all in one synthetic policy with no DNS evaluation. Include, a, mx, redirect and other mechanisms are intentionally rejected rather than guessed. SPF neutral (valid policy with no match) differs from none (no discovered policy). SPF authenticates an SMTP identity, not the visible From field.
See the article’s protocol sources and model limits. The scene does not alter a real system.
How the mechanism works
Evaluation follows the RFC-defined mechanism order and modifiers rather than a textual search for an IP. An ip4 mechanism can authorize a matching source address; all matches anything and its qualifier sets the result (- fail, ~ softfail, + pass, ? neutral). The model covers only ip4 and all; actual SPF also has domain-based mechanisms such as include, a and mx that can trigger DNS lookups. The real protocol limits the number of DNS-query-causing terms; this is not a limit on the count of TXT records in a zone.
For the selected identity, multiple distinct records beginning v=spf1 produce a policy error rather than a valid concatenation. An absent record is none, a valid record with no matching mechanism is neutral, and a temporary lookup failure is temperror. Forwarding can change the apparent sending IP and cause SPF checks to fail despite legitimate original submission; DKIM and DMARC use different evidence and should be assessed separately.
Primary protocol documentation provides the underlying rules; the interactive state is only a synthetic illustration.
In practice
For a real mail-domain change, first identify the exact MAIL FROM domain used by your sending system and its legitimate outbound IPs. Inspect the existing SPF policy read-only and the official sender documentation; never add every vendor blindly. Record the previous TXT RRset and preserve unrelated verification records. Validate the proposed policy with authorized test traffic and the receiver's authentication results before wider rollout. Stop if the true sending topology or DNS-query budget is unknown; a broad +all is not a safe debugging remedy.
Limits and common mistakes
This toy evaluator does not perform DNS recursion, HELO selection, all SPF mechanisms, modifiers or full protocol processing. Domain input and IPv4 are bounded. A passing SPF check neither proves that a visible author is legitimate nor guarantees inbox placement.
Key takeaways
SPF checks an SMTP envelope identity against the connecting sender IP; it does not authenticate the visible From: header by itself. pass, fail, softfail, neutral, none, temperror and permerror carry different meanings. Never merge separate SPF TXT records or treat an unsupported mechanism as permission.
Frequently asked questions
Editorial questions, answered from the sources listed for this article.
Does SPF validate what a person sees in From?
Not by itself. SPF checks SMTP identities; DMARC requires alignment with the visible author domain when using SPF as evidence.
Sources & model boundaries
Primary references used for this explanation. The interactive example is an educational model, not a live check.
- Sender Policy Framework (SPF)
DNS record selection and evaluation (§§3–4); mechanism results (§8). SPF identity, TXT assembly, multiple records, mechanisms, results and DNS-term limits; verify subsequent updates.
Checked .
- Domain-Based Message Authentication, Reporting, and Conformance (DMARC)
Author Domain, SPF/DKIM alignment and policy evaluation (DMARC assessment sections). PublishedMay2026; obsoletes7489/9091. Alignment, author/SPF/DKIM domains, policy and organizational boundaries; current DNS tree-walk definitions.
Checked .