How does SPF work?
SPF works by checking the connecting server’s IP against the SPF record of the return-path domain, the bounce address your sending platform sets behind the scenes. The receiving server runs this check in five steps:
-
Your sending platform connects to the receiving server
-
The receiving server reads the return-path domain
-
A DNS lookup fetches that domain's SPF record
-
The server checks the connecting IP against the record's rules
-
The check returns a result such as pass, softfail, fail (hardfail), or permerror
The return-path domain isn’t always the same as the visible From domain. SPF checks the former, not the address your subscriber sees. This means SPF alone can’t stop someone from spoofing your visible From address.
What does an SPF record look like?
An SPF record is a DNS TXT entry that starts with v=spf1. It then lists authorized senders through mechanisms such as include: and ip4:. At the end, an all mechanism defines the policy for senders that don’t match the listed rules.
| Tag | What it means | Example |
|---|---|---|
| v=spf1 | Marks the record as SPF, and always comes first | v=spf1 |
| include: | Checks another domain’s SPF record for authorized senders | include:_spf.emailplatform.example |
| ip4: | Authorizes a specific IPv4 address or network | ip4:198.51.100.25 |
| ~all | Softfail, which flags any unlisted sender as suspicious | ~all |
| -all | Hardfail, which asks receivers to reject any unlisted sender | -all |
Every SPF record must follow three rules:
- One record per hostname: Multiple SPF records for the same hostname cause a permanent error (permerror)
- End with an "all" mechanism: This defines the result for senders that don’t match earlier mechanisms
- Stay within 10 DNS lookups: SPF allows up to 10 DNS-querying terms during evaluation, including nested lookups
How does SPF work with DKIM and DMARC?
SPF checks whether the connecting server is authorized to send for the return-path domain. DKIM verifies the message’s digital signature. DMARC checks whether SPF or DKIM passes and aligns with the domain shown in the From address.
| Protocol | What it checks | What it can’t do |
|---|---|---|
| SPF | Whether the return-path domain authorizes the connecting server | Authenticate the visible From address |
| DKMI | Whether the message’s digital signature verifies against the signing domain | Set a policy for authentication failures |
| DMARC | Whether SPF or DKIM passes and aligns with the visible From domain | Authenticate messages without SPF or DKIM |
SPF can pass while DMARC fails because the return-path domain may not match the visible From domain. This is called an alignment failure. DKIM can provide the aligned result instead if its signing domain matches the visible From domain.
Learn how to configure the policy in our guide to setting up DMARC.
Why does SPF matter for online stores?
SPF helps online stores authenticate their emails and meet mailbox providers’ sender requirements. It also helps protect store domains from spoofing.
Google requires all senders to personal Gmail accounts to use SPF or DKIM authentication. Bulk senders must configure SPF, DKIM, and DMARC.
Google defines bulk senders as those sending 5,000 or more messages daily to personal Gmail accounts. A DMARC policy of p=none meets its minimum policy requirement. Your From domain must also align with SPF or DKIM.
Yahoo and Microsoft also require bulk senders to use SPF, DKIM, and DMARC. Microsoft’s rule covers domains that send more than 5,000 emails a day to Outlook.com, Hotmail, and Live addresses, according to its high-volume sender requirements.
For stores, authentication failures can send order confirmations, abandoned-cart emails, and campaigns to spam or cause them to be rejected. Spoofed order emails can also damage customer trust.
Proper authentication supports your email sender reputation. See our wider guide to improving email deliverability for more checks.
How does SPF work when you send through an email platform?
When you use an email platform, it may ask you to add an include: mechanism to your SPF record. This tells receiving servers to check the platform’s SPF record to see whether its servers are allowed to send emails. The platform provides the domain you need to add.
Most stores use more than one service to send emails. Your ecommerce platform may send order confirmations, while your email platform sends campaigns. You may also use a helpdesk and Google Workspace for customer support and business emails.
SPF checks the return-path domain used by each service, which may differ from the visible From address.
If several services use the same return-path domain, their sending permissions must go into one SPF record for that domain. Add each required include: entry to the existing record. If a service uses a different return-path domain, its SPF check uses that domain’s record instead.
This is why you should check the return-path domain before changing your SPF record.
The mistake I see most often is a store adding a second SPF record instead of editing the one it already has. A domain can only have one, so the two cancel each other out and SPF fails for every tool the store sends through, not just the new one.

Common SPF mistakes
Common SPF mistakes include duplicate records, excessive DNS lookups, and missing senders. Each can cause authentication failures or delivery problems.
- Publishing multiple SPF records: This causes a permanent error (permerror). Merge the entries into one record for that hostname.
- Exceeding 10 DNS lookups: SPF evaluation fails when lookup limits are exceeded. Remove unused services and unnecessary “include:” entries.
- Forgetting a new sending tool: Its emails may fail SPF authentication. Add the sender’s required authorization to the correct SPF record.
- Switching "~all" to "-all" too early: Legitimate senders may fail SPF. Verify every sending source before enforcing a hardfail policy.
Forwarding can also break SPF because the forwarding server may not be authorized. SPF doesn’t protect the visible From address.
Read our guide to learn how to troubleshoot SPF errors.
How Omnisend handles SPF
Omnisend provides domain authentication records under Store settings → Domains.
You add the supplied DNS records through your domain provider, then verify them in Omnisend. When you send through Omnisend, the return-path domain is the sender domain you add and authenticate there. Its SPF record uses the value v=spf1 include:mailgun.org ~all. If that domain already has an SPF record, add include:mailgun.org to it instead of publishing a second record.
Domain authentication is included on every plan. See the SPF, DKIM, and DMARC setup guide for instructions.
FAQ
How do I check my SPF record?
Open a delivered message in Gmail, select Show original, and check the spf= result. Online SPF lookup tools also let you view your domain’s published TXT record and check for errors.
What's the difference between ~all and -all?
The ~all mechanism returns a softfail, while -all returns a hardfail. Both mark unmatched senders as unauthorized. Still, receiving servers get to decide how to handle each result. Use -all only after listing and testing every sending tool
Are SPF records still used?
Yes. Google requires either SPF or DKIM for all senders, and bulk senders must use both plus DMARC. Yahoo guidelines also mention similar authentication requirements and ask for a valid SPF record.
Do I need SPF if I already have DKIM?
Yes. SPF and DKIM validate different parts of an email. Because DMARC requires at least one to pass and align, using both maximizes deliverability.
OFFER
