SPF

Sender Policy Framework — DNS TXT record listing which hosts may send mail for a domain; limited to 10 DNS lookups.
Platform & Operations. Last reviewed July 2026.
In this entry

2serious gotchas
1regular gotcha
3tips
Definition
SPF (Sender Policy Framework) is a DNS TXT record on a domain (or MAIL FROM domain) that lists which IP addresses / includes are authorized to send mail for that domain. Receivers check the SMTP envelope sender (Return-Path) against SPF. Common mechanisms include ip4:, ip6:, include:, and a/mx.
When to use it
- Every sending domain and custom MAIL FROM domain used with Amazon SES or any ESP
- As one leg of DMARC (alongside DKIM) for bulk-sender compliance
When not to use it
- Flattening dozens of vendor includes into a single static IP list you never update — breaks when vendors rotate
- Relying on SPF alone for brand protection — DMARC + DKIM are required for modern bulk rules
Tips
- Stay under the 10 DNS lookup limit (
include,a,mx,redirect, andexistscount) - Prefer SES custom MAIL FROM so SPF authenticates a domain you control and can align for DMARC
- Use
~all(softfail) or-all(fail) intentionally; softfail is common during migration
Gotchas
Serious
- Lookup limit exceeded → SPF PermError → DMARC alignment fails even if “you included everyone”
- Publishing SPF on the organizational domain but sending with a Return-Path that never matches
Regular
- Multiple SPF TXT records on the same name (invalid) instead of one merged record
Related FactualMinds content
Ask
Our AWS-certified team implements, audits and tunes SPF in production. Tell us what you are building.
Pictures:James Murray in the Scriptorium (public domain); Card Division of the Library of Congress, 1900–1920 (public domain); Salle des catalogues, Bibliothèque Mazarine, Paris, Marie-Lan Nguyen (CC BY 2.0); Copyright card catalog drawer, Michael Holley Swtpc6800 (public domain); Type in sort case, Edinburgh City of Print (CC BY 2.0); Widener Library reading room, 1920 (public domain). Via Wikimedia Commons.

