Skip to content
FunnelGuard

Fix guide by FunnelsGuard

SPF missing SendGrid, Mailgun or Postmark include: how to fix it

DLV-051High impactDetectedBy FunnelGuardPublished Updated
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.

Where a lead is lost
  1. Visitor submits formForm shows a thank-you message
  2. Sent via ESPSendGrid, Mailgun or Postmark sends from your domain
  3. SPF checkESP not in your SPF record
  4. InboxSpam folder or rejected
  5. Follow-upNobody replies to the lead

The form works, but the notification fails SPF at the receiving server.

Notifications reaching the inboxExample numbers
Notifications reaching the inbox (example)SPF failing: 55 %; SPF passing: 96 %037745596SPF failingSPF passing%

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

Check your SPF record
  1. 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

  2. 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.

  3. 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.

  4. 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.

Look up the SPF recordbash
dig TXT yourdomain.com +short | grep spf1

How 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.

Common SPF includes (confirm in your ESP's dashboard)
ESPInclude to add
SendGridinclude:sendgrid.net
Mailguninclude:mailgun.org
Postmarkinclude:spf.mtasv.net
SPF record change

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
Where to edit the record
  1. 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.

  2. Edit the existing TXT record

    Find the v=spf1 record and insert the include before the final ~all or -all. Save it.

How to confirm it's fixed

Verify the fix
  1. Wait for DNS to update

    Changes can take minutes, sometimes up to the record's TTL, which is its cache time.

  2. Re-run the lookup

    Confirm there is one v=spf1 record and it contains the ESP include.

  3. Send a real test

    Submit your own form and open the received email's original headers. You want spf=pass.

  4. Check the ESP dashboard

    SendGrid, Mailgun and Postmark show whether the domain is authenticated.

How to prevent it happening again

Keep SPF healthy
  • 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.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: email_dns spf_includes; email_auth SPF fail.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.