GTM Engineering term, email infrastructure

SPF

SPF (Sender Policy Framework) is a DNS record listing which mail servers are allowed to send email on behalf of your domain.

Also called: Sender Policy Framework, SPF record, SPF TXT record, SPF lookup limit

SPF lives in reach, the part of the funnel about reaching buyers, near related terms like DKIM, DMARC and Cold Email Deliverability (the blue squares).

SPF, or Sender Policy Framework, is a DNS record that lists which mail servers are allowed to send email on behalf of your domain. Receiving servers check it to spot mail pretending to come from you. It's one of three authentication records, along with DKIM and DMARC, that every sending domain needs before it sends a single email.

How it works

SPF lives as a TXT record on your domain. When a server receives an email claiming to be from your domain, it looks up that record and checks whether the sending server is on the list. If it is, SPF passes. If not, it fails, and the receiver weighs that when deciding inbox, spam or reject.

One detail trips up a lot of teams: SPF checks the envelope sender (the hidden Return-Path or MAIL FROM address), not the From address people see. That's why DMARC alignment matters. SPF can pass on a vendor's bounce domain while doing nothing for your brand.

A basic record looks like this:

v=spf1 include:_spf.google.com ~all

That says Google Workspace may send for this domain, and anything else should be treated with suspicion. The ~all ending is a soft fail. -all is a hard fail. Each tool that sends as your domain, like your marketing platform or helpdesk, needs its own include, using the value from that tool's setup docs.

Common mechanisms you'll see:

  • include: pulls in another domain's SPF list, typically a vendor's.
  • ip4: and ip6: list specific sending IP addresses.
  • a and mx authorize the servers in your A or MX record.
  • redirect= hands the whole policy to another domain.

One technical limit trips people up: SPF allows a maximum of 10 DNS lookups. Every include can add lookups, so stacking tools can quietly break the record.

Example

A company sends cold email from a secondary domain through Google Workspace, and newsletters from the main domain through HubSpot. Each domain gets its own SPF record listing only the services that send from it. The secondary domain doesn't need HubSpot's include, and keeping records minimal makes problems easier to spot.

Now the lookup math on the main domain. Say Google's include costs about 4 lookups once nested includes are counted, the marketing platform 2, the helpdesk 1, a billing tool 1 and an old webinar tool someone trialed 2. That's 10 lookups, right at the ceiling. Add one more tool and every email from the main domain fails SPF. Removing the unused webinar include buys back room.

How to set it up

  1. List every service that sends mail as each sending domain.
  2. Build one TXT record per domain, starting v=spf1, with each service's include.
  3. End with ~all or -all.
  4. Check the lookup count with an SPF checker before publishing.
  5. Send a test email and confirm spf=pass in the headers.
  6. Review the record every time a tool is added or removed.

Common mistakes

  • Creating two separate SPF records on one domain instead of one combined record.
  • Going over the 10-lookup limit by adding every tool ever trialed.
  • Forgetting SPF on new secondary sending domains.
  • Treating SPF alone as enough, without DKIM and DMARC.
  • Using +all, which authorizes every server on the internet to send as you.
  • Assuming SPF passing means your mail is aligned, when it passed on a vendor's bounce domain.

Why it matters for GTM teams

Missing or broken SPF is one of the easiest ways to land in spam, and it's free to fix. Mailbox providers list SPF in their sender requirements, and it's part of the bulk sender requirements baseline. Every sending domain your team owns should have it set up before a single cold email goes out, and before domain warmup even starts.

FAQ

What is the SPF 10 lookup limit?

The SPF standard limits a record to 10 DNS lookups during evaluation. Each include, a, mx, exists and redirect mechanism can add lookups, and nested includes count too. Go over the limit and SPF returns a permanent error, which receivers treat as a failure.

Should I use ~all or -all in my SPF record?

~all is a soft fail that tells receivers to treat unlisted senders with suspicion, while -all is a hard fail that says reject them. Many teams use ~all and let DMARC enforce the policy, since DMARC is where the real decision is made. Either is fine once every legitimate sender is listed.

Can a domain have two SPF records?

No. A domain must publish exactly one SPF record. Two records make SPF return a permanent error, so merge every sending service into one record with multiple includes.

See all email infrastructure terms ↳

Used in these articles