What is SPF?
SPF (Sender Policy Framework) is a list, published in your DNS, of the servers allowed to send email for your domain. When Gmail or Outlook receive an email from you, they check whether it came from one of those servers.
Why it matters
Without SPF, or with a broken one, more of your email lands in spam, and it's easier for scammers to send email in your name. Gmail, Yahoo and Microsoft now require SPF or DKIM from every sender, and both from bulk senders.
What a good record looks like
One record, starting with v=spf1, listing each service that sends email for you, and ending with ~all or -all:
v=spf1 include:_spf.google.com include:mailgun.org ~all
Common mistakes
- Two SPF records. Only one is allowed; with two, both are ignored. Merge them into one.
- More than 10 lookups. Each include costs at least one, and the includes inside it count too. Go over 10 and SPF stops working.
- Adding services that don't need to be there. Mailchimp, Shopify, Klaviyo and others send from their own address; they only need DKIM.
- Ending with +all, or a bare all, which allows anyone in the world to send as you.
- Writing include= or ip4: with a server name. SPF ignores the whole record when one part is wrong.