SPF, or Sender Policy Framework, is an email authentication mechanism that publishes a policy in DNS indicating which servers are authorized to send messages using a domain in the technical sender field. The record is published as a TXT record and is checked by the receiving server during message evaluation. SPF can reduce unauthorized use of a domain in the SMTP path but does not encrypt mail, sign content, or guarantee that an email is legitimate. It is a component that must be coordinated with DKIM and DMARC to provide comprehensive protection.
How it works
The domain owner publishes an SPF policy that lists authorized sources via IP addresses, mechanisms, or provider inclusions. The receiving server compares the actual connection source against the policy and returns a result such as pass, fail, softfail, neutral, or permerror. The precise semantics depend on the mechanisms and modifiers used. A permissive policy may not block unauthorized senders; a restrictive one might reject legitimate emails if a service is forgotten. Configuration must reflect all systems sending mail for the domain to avoid misconfigurations.
A domain should have only one valid SPF record; publishing more than one can cause a permerror, leading to authentication failures. The policy has a limit on DNS lookups caused by mechanisms performing lookups; exceeding this can invalidate the check. Nested inclusions and marketing services can quickly consume the lookup budget. Periodic verification of each provider’s documentation, removal of deprecated sources, and cautious use of analysis tools are necessary. TXT syntax must comply with quoting rules and DNS provider limits to ensure proper parsing.
SPF, DKIM, and DMARC
SPF checks the transport source and technical identity, which may differ from the visible address in the From field. DKIM adds a cryptographic signature associated with a domain; DMARC verifies alignment between the visible domain and SPF or DKIM results, and can publish policy and report addresses. Configuring SPF alone does not protect against all forms of visible sender spoofing. The three technologies complement each other and should be implemented with testing and monitoring to ensure effectiveness.
During an email migration, SPF records must include the new provider before sending begins and remove the old one only when no longer needed. If DNS is migrated, the zone must include all TXT records to maintain continuity. Changes may remain cached until TTL expires, potentially causing temporary disruptions. Header and authentication reports are analyzed to verify results, with care taken that an SPF pass does not equate to a positive spam filter evaluation.
Privacy and maintenance
The SPF record is public in DNS and reveals which services are authorized to send mail. Policies should avoid unnecessary inclusions or third-party domains no longer under control. A too-permissive SPF increases the attack surface, while an incorrect policy can cause bounces or communication loss. An organization should assign a record owner and document the source of each include to ensure accountability and maintainability.
In summary, SPF publishes a DNS policy to verify authorized email senders. It is useful against technical spoofing but requires a complete inventory of sources, a single valid policy, and coordination with DKIM and DMARC for full protection. Proper configuration and ongoing maintenance are essential for optimal performance and security.
← Full glossary