SPF (Sender Policy Framework)
SPF (Sender Policy Framework) is an email security standard that lets a domain owner publish, in DNS, which mail servers are allowed to send email for their domain, so receiving servers can spot messages from unauthorized senders.
Also called: Sender Policy Framework, SPF record, SPF check
What is SPF?
SPF is one of three standards, with DKIM and DMARC, that stop criminals sending email that pretends to come from your domain. It works through a simple list published in your domain's DNS: these are the servers allowed to send our mail.
How does SPF work?
- You publish a TXT record such as `v=spf1 include:_spf.google.com include:sendgrid.net -all`.
- When a server receives an email claiming to be from your domain, it checks which server actually sent it.
- If that server isn't on your list, the message fails SPF. The `-all` at the end tells receivers to treat everything else as unauthorized; `~all` is a softer "suspicious".
SPF is defined in RFC 7208. CISA has required SPF, DKIM and DMARC on federal domains since BOD 18-01, and Google and other mailbox providers now require authentication from senders, especially bulk senders.
Common SPF mistakes
- Forgetting services that send on your behalf, such as your CRM, invoicing or newsletter tool, so real emails fail.
- Too many lookups: SPF allows at most 10 DNS lookups; going over makes the whole record fail.
- More than one SPF record on the same domain, which is invalid.
- Ending with `+all`, which authorizes everyone.
SPF's limits
SPF checks the hidden "envelope" sender, not the From address people see, and breaks when mail is forwarded. That's why it needs DMARC, which ties SPF and DKIM results to the visible From address and tells receivers what to do with failures.
Related terms
Sources
Drafted with AI assistance, then edited and fact-checked by a person. How we use AI.
