Find problems in your SPF record
A mistake in your SPF record can mean mail from your own services doesn't pass SPF. Learn what each SPF error means and how to correct it.
Read the parts of an SPF record
v=spf1
Identifies a TXT record as SPF. The mechanisms that follow it say which sending servers are allowed.
ip4 and ip6
Authorize the IP addresses or address ranges written in the record.
include
Uses another domain's SPF policy to authorize senders. That policy can lead to further DNS lookups of its own.
all
Matches any sender that earlier mechanisms didn't match. Its qualifier determines the result for those senders.
These terms come from RFC 7208.

Keep one SPF record at each domain name
Different mail services must share one SPF record for the same DNS name. Publishing a separate SPF record for each service creates a permanent error. A single TXT record split into quoted strings is different from multiple SPF records.
Follow includes when counting DNS lookups
SPF allows at most 10 terms that trigger DNS lookups during a check, including terms reached through nested includes and redirects. The initial SPF lookup doesn't count toward that limit. Going over it produces a permanent error.
The limit counts only terms that are evaluated and trigger lookups, not every word in the record. Direct IP mechanisms don't count toward it. Review senders you no longer use and repeated includes before adding another mail service.
The counting rules are in RFC 7208, section 4.6.4.
Tell a sender failure from a record error
| Result | Meaning |
|---|---|
| Softfail | The ~all ending says an unmatched server is probably unauthorized. That's weaker than fail; it doesn't tell the receiver where to deliver the message. |
| Fail | The -all ending says an unmatched server is unauthorized. The receiver still decides how to handle the message. |
| Permerror | The published policy can't be evaluated correctly. Fix the DNS policy rather than retrying the same message unchanged. |
| Temperror | A temporary problem, usually with DNS, prevented evaluation. A later attempt may succeed. |
Frequently asked questions
Should I switch from softfail to fail?
First list every service that sends using this domain. A stricter ending changes what the record says about senders outside that list; it doesn't authorize a sender you left out.
Explore the rest of your email setup
SPF, DKIM and DMARC
Find out why your emails land in spam, and who else can send mail as you.
DKIM record
Lets receivers check each message's signature against a key your domain publishes.
DMARC record
Tells receivers what to do with mail that fails, and where to send reports.
Why your site's emails go to spam
Work through authentication, sender setup and the signals a DNS scan can't see.