On this page
What this issue is
SPF (Sender Policy Framework) is a TXT record in your domain's DNS. It lists which servers may send email using your domain. Receiving servers check it and mark the message pass, softfail or fail.
An ESP (email service provider) such as SendGrid, Mailgun or Postmark sends mail on your behalf, often form notifications, order emails and lead alerts. If the ESP's servers are not named in your SPF record, they are not authorised. The check can then fail even though the mail is genuine.
Why it costs you leads or sales
Many website forms send two emails: a notification to you and a confirmation to the customer. When SPF fails, mailbox providers may put these in spam, tag them as suspicious or reject them. You then miss new leads, or customers never see order and booking confirmations and assume the purchase failed.
The form itself looks fine and the submission may be saved. That is why the damage often goes unnoticed for weeks.
- Visitor submits formForm shows a thank-you message
- Sent via ESPSendGrid, Mailgun or Postmark sends from your domain
- SPF checkESP not in your SPF record
- InboxSpam folder or rejected
- Follow-upNobody replies to the lead
The form works, but the notification fails SPF at the receiving server.
Example: illustrative numbers showing how many of 100 notification emails reach the inbox before and after the SPF fix.
How to check if your site has it
Find your current SPF record
Run a DNS lookup for TXT records on your domain. Look for the one starting with v=spf1. In a terminal: dig TXT yourdomain.com +short
Identify who really sends your mail
List every service that sends from your domain: your mailbox provider, your form plugin, your shop, your CRM and any ESP. Check each tool's email settings for the sending service.
Compare record and senders
Each ESP needs its include in the record: SendGrid include:sendgrid.net, Mailgun include:mailgun.org, Postmark include:spf.mtasv.net.
Read a real message header
Open a received notification, view the original message and look for Authentication-Results. spf=fail or spf=softfail confirms the problem.
dig TXT yourdomain.com +short | grep spf1How to fix it
The rule: a domain must have one SPF record only. Edit the existing record and add the include. Do not create a second v=spf1 record, as that causes a permerror.
| ESP | Include to add |
|---|---|
| SendGrid | include:sendgrid.net |
| Mailgun | include:mailgun.org |
| Postmark | include:spf.mtasv.net |
Before
- v=spf1 include:_spf.google.com ~all
- SendGrid mail is not authorised
After
- v=spf1 include:_spf.google.com include:sendgrid.net ~all
- Google and SendGrid are both authorised
Open your DNS host
Log in where your nameservers point (Cloudflare, GoDaddy, Namecheap, Route 53 or your registrar). SPF is edited there, not in your website.
Edit the existing TXT record
Find the v=spf1 record and insert the include before the final ~all or -all. Save it.
Find the sender
In your SMTP or form plugin settings (for example WP Mail SMTP), note which ESP is used.
Edit DNS, not WordPress
Add the include at your DNS host. The plugin cannot change SPF for you.
Open Settings > Domains
If you use a third-party ESP for Shopify Email alternatives, edit DNS where the domain is managed. If Shopify manages DNS, use Manage > DNS settings.
Edit the TXT record
Add the include to the existing SPF TXT record. Shopify's own sending does not need extra includes.
Open dedicated domain settings
In Settings > Email Services, check the dedicated sending domain and the DNS records it asks for.
Apply at your DNS host
Add the listed records there. Merge SPF values into one record if you already have one.
How to confirm it's fixed
Wait for DNS to update
Changes can take minutes, sometimes up to the record's TTL, which is its cache time.
Re-run the lookup
Confirm there is one v=spf1 record and it contains the ESP include.
Send a real test
Submit your own form and open the received email's original headers. You want spf=pass.
Check the ESP dashboard
SendGrid, Mailgun and Postmark show whether the domain is authenticated.
How to prevent it happening again
- Update SPF whenever you add or switch a tool that sends email
- Keep one SPF record per domain
- Remove includes for services you cancelled
- Set up DKIM and DMARC alongside SPF
- Test a real form submission after any DNS or plugin change
- Keep a note of every sender and its include
How FunnelGuard handles this
FunnelGuard detects this issue. Its email DNS check (spf_includes) reads your domain's SPF record and looks for the includes your sending services need. Its email authentication check flags when SPF fails for mail sent from your domain.
FunnelGuard also runs your lead forms on a schedule and checks whether test leads reach the inbox and CRM. A failure is re-checked from a second region before one alert goes out, with a screenshot and a likely cause. Test traffic is marked and never bypasses CAPTCHAs. The Free plan covers 1 site and 2 journeys with daily checks, no card needed, and paid plans have a 3-day free trial.
Questions people ask
Why are my form emails going to spam after I started using SendGrid?
Often your SPF record does not include SendGrid, so receiving servers see mail from an unauthorised sender. Add include:sendgrid.net to your existing SPF record and check DKIM is set up too. Then send a test and look for spf=pass in the headers.
How do I add Mailgun to my SPF record?
Edit your existing SPF TXT record at your DNS host and add include:mailgun.org before the final ~all or -all. Do not create a second SPF record. Confirm the exact value in your Mailgun domain settings.
What is the SPF include for Postmark?
Postmark commonly uses include:spf.mtasv.net. Check your Postmark sender signature or domain settings to confirm the value for your account, and merge it into your single SPF record.
Can I have two SPF records, one for Google and one for SendGrid?
No. A domain must have only one SPF record. Two records cause a permerror and SPF fails. Combine all includes into one v=spf1 line.
Does SPF failing mean my emails are always rejected?
Not always. It depends on your policy (~all gives softfail, -all gives fail) and on the receiver. Many providers send failing mail to spam, and DMARC policy can make it stricter.
How do I check if SPF is passing for my emails?
Open a received email, choose Show original or View source, and find Authentication-Results. Look for spf=pass. You can also look up your TXT records with dig or an online SPF checker.
How long does an SPF change take to work?
Often minutes, but it can take as long as the record's TTL, sometimes hours. Re-check the record and then send a fresh test email.
Related issues
- DLV-048Domain has no SPF recordFix guide
- DLV-049SPF exceeds 10 DNS lookups (permerror)Fix guide
- DLV-050Multiple SPF records on the domainFix guide
- DLV-052DKIM selector record missing or wrong keyFix guide
- DLV-053DMARC record missing (Gmail/Yahoo bulk sender requirement)Fix guide
- DLV-054DMARC alignment fails because From domain differs from the sending domainFix guide