What is SPF (Sender Policy Framework)?
A DNS record that lists which servers are allowed to send email for a domain.
How it works in practice
When a message arrives, the receiving server looks up the SPF record of the domain in the envelope sender (the Return-Path) and checks whether the connecting IP is on the list. The result is pass, fail, softfail or neutral. SPF is limited to 10 DNS lookups per check, so every include for a sending service counts against it.
How an SPF check runs
The receiving server takes the domain from the envelope sender (the Return-Path, or the HELO name if the sender is empty), looks up its SPF record and compares the IP address that is delivering the message with the list. The outcome is one of pass, fail, softfail, neutral, none, temperror or permerror, and it is written into the Authentication-Results header of the message.
What a record looks like
An SPF record is a TXT record that starts with v=spf1, followed by mechanisms such as include:, ip4:, ip6:, a and mx, and ends with an all term that says what to do with everything else. Each include pulls in the list of another service. Only one SPF record is allowed per domain, and it sits on the exact domain that sends, not on its parent.
Where SPF falls short
SPF checks the envelope sender, not the From address people see, so on its own it does not stop someone from spoofing your visible From domain. It also breaks when a message is forwarded, because the forwarder's IP is not on your list. That is why SPF is paired with DKIM and DMARC rather than used alone.
The common mistake
Adding a new sending tool as another include without counting lookups, until the record passes 10 and SPF fails with a permerror for every message.
Frequently asked questions
Do I need SPF if I already have DKIM?
Yes. Gmail and Yahoo expect bulk senders to have both, and DMARC can pass on either one, so having both gives a fallback when one of them breaks, for example when mail is forwarded.
Can a domain have two SPF records?
No. Two records starting with v=spf1 on the same domain cause a permanent error and SPF fails for every message. Merge the senders into one record.
Does SPF cover subdomains?
No. A record on example.com is not inherited by mail.example.com. Every domain or subdomain that sends mail needs its own record.
Check it yourself
Related terms
Not sure whether this is what's hurting your inbox placement? A free deliverability review finds the real cause.
How we help: Consulting · Private infrastructure · Managed mailboxes · Monthly support