SPF
acronymStands for: Sender Policy Framework
An email-authentication method in which a domain publishes in DNS the hosts allowed to use its name in SMTP.
Sender Policy Framework (RFC 7208) lets a receiving mail server test whether the connecting host may use the domain given in SMTP's MAIL FROM or HELO. It checks that envelope identity, not the From header the reader sees; DMARC, now RFC 9989, ties the result to the From domain, alongside DKIM.
The policy is one TXT record at the domain itself, starting with exactly "v=spf1"; two such records give a permerror. Its mechanisms (all, include, a, mx, ptr, ip4, ip6, exists) are tried left to right against the client's address, and the first match returns its qualifier: + pass (the default), - fail, ~ softfail, ? neutral. With no match the result is neutral, hence the closing "-all" of domains that want a firm no. The rest are none (no record), temperror (a transient, generally DNS, error) and permerror (an uninterpretable record).
Evaluation may use at most 10 terms that query DNS (include, a, mx, ptr, exists, redirect); one more gives permerror, while ip4, ip6 and all cost nothing. RFC 7208 (Proposed Standard, April 2014; updated by RFCs 7372, 8553 and 8616) says ptr should not be published and mandates no handling for any result.
SPF authorises the envelope sender (MAIL FROM, or postmaster at the HELO name if the reverse-path is null) and the HELO name, never the From header, so a sender can pass with its own domain and display another. Forwarding breaks it: the receiver tests the forwarder's address, so an unrewritten MAIL FROM fails. DMARC counts only a MAIL FROM pass whose domain aligns with the From domain.
In routing, SPF means shortest path first, OSPF's Dijkstra computation (RFC 2328, section 16.1): see Dijkstra's algorithm.
Also known as: spf, sender policy framework, spf record, v=spf1, spf txt record
Sources
- RFC 7208, Sender Policy Framework (SPF) for Authorizing Use of Domains in Email, Version 1, April 2014: sections 1, 1.1.3, 2.1 to 2.6, 3, 4.5 to 4.7, 5, 5.5, 10.2, 10.3 and 11.2 (read 2026-10-19)
- RFC Editor, information page for RFC 7208: status, obsoletes and updated by (read 2026-10-19)
- RFC 9989, Domain-Based Message Authentication, Reporting, and Conformance (DMARC), May 2026: sections 3.2.2, 3.2.4, 4.3, 4.4.2 and 7.1 (read 2026-10-19)
- RFC 2328, OSPF Version 2, April 1998: sections 1 and 16.1 (read 2026-10-19)