Definition of SPF: How Sender Policy Framework Works

Learn the definition of SPF and how Sender Policy Framework protects your email domain from spoofing and phishing attacks.

Published on

Updated

Definition of SPF: How Sender Policy Framework Works
Do not index
Do not index
SPF (Sender Policy Framework) is a DNS TXT record that lists which mail servers are authorized to send email on behalf of your domain, so receiving servers can reject or flag messages from anywhere else. That matters because if SPF is broken, your password resets, booking confirmations, and outbound sequences can start landing in spam instead of inboxes, and the damage shows up fast in replies, onboarding, and revenue.
You can think of SPF as a domain-level guest list for email. The receiving mail server checks that list during delivery, and if the sender isn't on it, the message looks suspicious even before the content is read. For a founder, that means SPF is not a technical nicety, it's one of the first signals that decides whether your mail gets trusted.
Table of Contents

Why Your Transactional Emails Are Suddenly Landing in Spam

A startup team usually notices the problem in the worst possible place. A customer says they never got a password reset, a lead books a demo but misses the confirmation, or a sales rep swears the sequence was perfect and still got silence. By the time someone checks the inbox placement issue, the business pain is already obvious.
The cause is often quieter than the symptom. A new email tool gets added, a marketing platform is left connected after a migration, or a DNS change breaks authentication for one sender while the rest of the stack keeps working. The visible From address still looks fine, but the receiving server sees a mismatch somewhere underneath.
That is why SPF matters to deliverability. It tells mailbox providers whether the infrastructure sending mail for your domain was approved to do so, and that signal helps them decide whether a message belongs in the inbox or the spam folder. If authentication is incomplete, even strong copy and a clean list can underperform.
For SMBs that need the bigger picture, a practical email security guide for SMBs can help frame SPF alongside broader domain protection. For a focused deliverability view, the pattern is the same every time, authentication problems reduce trust, and trust affects inbox placement.
The fastest way to stop guessing is to inspect the sending path, not just the message. That is why teams dealing with spam placement usually start by checking SPF, then DKIM, then DMARC, while also reviewing blacklist status and SMTP health. A separate breakdown of why emails go to spam is useful when the symptoms point beyond authentication and into reputation or infrastructure.

What SPF Actually Does and Why Receiving Servers Care

A sender can have a clean template and still fail authentication if the domain's publishing rules do not match the system that sent the message. SPF is the first place many receiving servers look for that mismatch. It works like a guest list for mail infrastructure, while DKIM and DMARC fill in the other two legs of the authentication stool.
notion image

The reservation analogy that makes SPF click

A domain owner publishes a DNS record that lists the approved senders. That record sits in DNS as a TXT record, so the policy is visible to any receiving server that checks it during SMTP. The server evaluates the sender before delivery, which means SPF influences whether the message is treated as expected mail or as something that deserves caution.
The easiest way to picture it is a restaurant reservation desk. If a delivery driver shows up with a name that is not on the list, staff still ask who the delivery was scheduled for before letting the boxes through. SPF uses the same kind of expectation check for email infrastructure. A receiving server compares the connecting host against the domain's published policy and asks whether that host was allowed to send on the domain's behalf.
This check applies to the identity the server is validating, usually the MAIL FROM or HELO identity, not the visible From header the recipient sees in the mailbox. That is the part that trips up many founders and operators. A message can look normal in the inbox view and still fail underneath because the authenticated sender and the displayed sender are not the same thing.
The protocol standard describes SPF as a DNS-based authentication method that lets a domain owner publish which hosts are authorized to send mail on behalf of that domain in the MAIL FROM or HELO identity, and receiving servers evaluate it during SMTP to classify hosts as permitted or not permitted. That classification is the point. Mailbox providers use it as one signal in a wider trust decision.

What the receiving server checks

At a high level, the server asks four questions. Is the sender authorized, is the record present, is the policy permissive, and what should happen if the sender is not listed. Those answers produce the familiar SPF results, pass, softfail, hardfail, or none.
SPF functions as a relative authorization check rather than a content-safety score or a full reputation system. It tells a receiver whether the sending infrastructure matched the published policy, nothing more. That is why SPF matters for inbox placement, but it cannot fix a weak list, a poor subject line, or a damaged sending reputation on its own.
For teams that want a broader protocol map, the guide to email authentication protocols gives a helpful side-by-side view of SPF, DKIM, and DMARC. A practical SPF record examples guide is useful next if you want to see how those rules look in actual DNS syntax.

Reading an SPF Record Line by Line with Real Examples

An SPF record starts with a version tag, then lists the mail sources that are allowed to send for the domain. The most basic possible version looks short because it is short, and that simplicity is useful when a domain needs to deny everything by default. The standard also notes that misconfiguration can break legitimate delivery when an authorized sender is omitted or when the lookup chain gets too deep.

A minimal record

A bare-bones example is v=spf1 -all. The v=spf1 part says this is an SPF policy, and -all means senders not listed anywhere else should fail.
That record is useful for domains that should not send mail at all. If a subdomain exists only for a website or app and no email should ever leave from it, a strict deny-all policy helps mailbox providers see that any mail claiming the domain is suspicious.
A softer version such as ~all says the sender is probably not approved, but receivers may treat it less harshly. That can be useful during migration, but it is not a great long-term shape for important transactional traffic.

A working multi-sender record

A real setup often has more than one sender, such as a workspace provider and a transactional platform. A clean record usually combines approved mechanisms and ends with a policy that matches the domain's actual mail posture.
v=spf1 include:_spf.example.com include:send.example.net -all
Read it left to right.
  • v=spf1 says this is an SPF policy.
  • include:_spf.example.com lets the record inherit authorization from another sender's published policy.
  • include:send.example.net adds a second approved provider.
  • -all tells receivers to fail everything else.
A record like that is common because no team sends from only one system forever. Marketing may use one vendor, product mail may use another, and support may use a third. The key is to keep the list current and limited to real senders.
For worked examples that show how different patterns look in the wild, the SPF record examples guide is a useful reference.

A broken record and what fails

A broken SPF setup often looks fine to a human because the text is still there. The problem is usually one of two things, the record is incomplete, or the path to evaluate it is too expensive.
A common failure looks like this in practice, a domain forgets to add a new platform after onboarding it, or a migration leaves an old include in place. In both cases, the receiver sees a mismatch between the sending host and the published policy, and the message gets a worse trust signal.
Another common failure is a malformed record that contains the wrong qualifier or an extra, unused sender path. The practical result is the same, legitimate mail starts failing authorization, and that hurts inbox placement even if the content is excellent.

The 10 DNS Lookup Rule and How to Manage Multiple Senders

SPF has one operational constraint that catches teams off guard, the receiver can only follow a limited number of DNS lookups while evaluating the policy. If the record chains through too many includes or related mechanisms, the evaluation can stop with a permanent error, which is treated like a failure.
That matters because modern domains often send from several systems at once. A workspace provider handles employee mail, a CRM sends one-to-one outreach, a marketing platform sends newsletters, and a transactional vendor sends product messages. Each one can add more lookup depth than the team expects.

How teams run into the ceiling

The easiest way to think about the limit is as a reservation desk with only a small number of calls allowed before it gives up. Every extra provider can trigger another lookup, and some nested includes cause more than one hop. That means a record that looked clean in the dashboard can still fail when the receiver evaluates it in real time.
The fix is not to pile on more includes. It is to audit which senders are still active, remove dead vendors, and keep the policy as direct as possible. When a sender is stable and controlled, using explicit IP ranges or isolating it on a subdomain can reduce unnecessary dependence on nested lookups.

Common SPF Include Values and Their Lookup Cost

Sender
Include value
Approx. lookups
Workspace email provider
Provider-specific include
1
CRM outreach platform
Provider-specific include
1 to 2
Transactional email service
Provider-specific include
1
Marketing automation platform
Provider-specific include
1 to 2
Legacy vendor still connected
Usually unnecessary
1 or more
The exact cost depends on how the vendor structures its own SPF policy, so the task is to count the active paths, not assume every include is cheap. A clean multi-sender setup usually starts with one primary include, then adds only the providers that need to send on the domain.

How SPF Works With DKIM and DMARC in Practice

A sender can pass SPF and still miss the inbox if the other checks do not support the same story. SPF covers one part of authentication, DKIM covers message integrity, and DMARC ties the results back to the visible From domain. Mailbox providers judge those signals together, the way a restaurant host checks a reservation name, a booking list, and the party at the door before seating anyone.
notion image

Three checks, three different jobs

SPF authorizes the envelope sender. DKIM signs the message so the receiver can verify that the content and headers have not been altered. DMARC tells the receiver how to handle failures and checks whether the visible From domain aligns with the authenticated domain used by SPF or DKIM.
That alignment rule is where many teams get surprised. A message can pass SPF on one domain and pass DKIM on another, yet still fail DMARC if the authenticated domain does not align with the visible From header. That failure can matter a lot for deliverability because DMARC is often the policy layer mailbox providers use to decide how strict they should be.
For a broader explanation of how these protocols fit together, the guide to email authentication protocols is a useful companion. A more practical internal breakdown is available in the email security protocols guide, especially when a team is deciding where SPF ends and the other checks begin.
The safest way to think about the three is this. SPF says who may send, DKIM says the message is intact, and DMARC says what the receiver should do if the authentication story breaks. SPF represents just one component of the authentication stool, and modern inbox placement usually depends on the full trio working together.

Common SPF Mistakes That Break Inbox Placement

Most SPF failures are not exotic. They're basic operational mistakes that happen when teams add tools quickly and forget that every sender changes the DNS picture. The result is usually a damaged trust signal, then spam placement, then a scramble to find which vendor caused it.
notion image

The mistakes founders keep repeating

  • Multiple SPF records. Only one SPF policy should be evaluated for a domain. When teams publish more than one, receivers can ignore or misread the setup, which can lead to a permanent error and blocked delivery.
  • Softfail on sensitive traffic. A permissive ~all can be tolerable during testing, but important transactional mail often needs a more deliberate policy shape. If unauthorized senders can still look “close enough,” spoofing risk stays higher than it should.
  • Forgotten third-party services. New platforms get added, old ones remain, and SPF no longer matches the sending stack. Legitimate mail then fails because the sender was never added to the approved list.

The symptom, impact, and fix

When the receiver sees a broken policy, the symptom is usually a failed authorization result or a permanent error during evaluation. The business impact is not abstract, it shows up as lower inbox placement, more spam-folder placement, and in some cases outright rejection. The fix is always the same shape, remove dead senders, add active ones, and keep the policy short enough to evaluate cleanly.
Publishing SPF on the wrong subdomain creates another easy-to-miss gap. If the mail is sent from a different domain than the one that holds the record, the receiver never checks the policy you thought it would. That's why sender architecture and DNS setup have to match.

Testing, Troubleshooting, and Maintaining Your SPF Setup

SPF is not a record you publish once and leave alone. Vendors change, sending services get added or retired, and DNS can drift until a record that used to match your mail flow no longer reflects reality. The right maintenance process is short, repeatable, and focused on one question: does the policy still match the servers sending for the domain?
A useful way to keep that question in mind is to treat SPF as one leg of a three-legged authentication stool. SPF, DKIM, and DMARC each carry a different part of the trust check, and if one leg is weak, the message can still wobble even when the others look fine. SPF answers a narrow question, whether the sending IP is allowed, while DMARC checks whether the domain story stays aligned across the layers.

A simple diagnostic workflow

Start with the DNS TXT record itself. That tells you whether the SPF policy is published, whether the syntax still starts cleanly, and whether the sender list matches what the team thinks is active. Then send a test message to a Gmail inbox and inspect the Authentication-Results header, because that shows how the receiving server evaluated the message in real conditions.
A restaurant reservation works like a helpful analogy here. SPF is the guest list for the table, DNS is the front desk holding that list, and the receiving server checks the name against the reservation before letting the mail in. If the list is too long or split across too many separate notes, the check gets harder and the chance of a mismatch rises.
A live tool can save time at this stage. A mailX SPF check can show whether the record is valid, whether the policy is likely to run into lookup limits, and which parts of the sender stack still need attention. For teams already checking SPF, DKIM, DMARC, MX, PTR, SMTP, and blacklist status, a combined view is often faster than jumping between separate tools.

Maintenance habits that keep SPF healthy

Review sender lists regularly. Old vendors should not stay in the record once they stop sending mail, and forgotten entries are one of the easiest ways for SPF to drift out of sync with reality.
Keep the record as clean as possible when multiple senders are involved. Each added platform is another branch in the reservation list, and each branch can add lookup depth. If the stack keeps growing, separate some services onto a subdomain so the main domain does not run into the 10-lookup ceiling while trying to approve too many systems at once.
Tighten the policy as confidence grows. A domain that begins with a permissive posture may later need a stricter one as DMARC enforcement becomes more deliberate and the sender set stabilizes.
Recheck after platform changes. Any CRM, ESP, or transactional switch can alter the sender path and break alignment without warning.
SPF also has to stay consistent with the rest of the authentication setup. A sender can pass SPF and still struggle with inbox placement if DKIM or DMARC tells a different story, or if the domain used in the envelope does not match the domain the team intended to authenticate. The safest maintenance habit is to verify SPF alongside DKIM, DMARC, blacklist status, and SMTP connectivity any time the sending stack changes.

FAQ

What is the definition of SPF?

SPF is a DNS-based email authentication policy that tells receiving servers which hosts are authorized to send mail for a domain. In practice, it helps mailbox providers decide whether a message looks like it came from approved infrastructure.

Why does SPF affect email deliverability?

Because mailbox providers use it as a trust signal. If SPF fails or is misconfigured, legitimate messages are more likely to be flagged, filtered, or rejected.

How do teams check an SPF record?

They inspect the domain's TXT record, confirm the syntax starts with v=spf1, and test the sending path against a real mailbox provider. A live deliverability check is faster when the stack includes multiple senders.

What usually breaks SPF?

Missing senders, multiple SPF records, too many DNS lookups, and records published on the wrong domain or subdomain are the usual causes. Vendor churn is the most common reason the record drifts out of sync.

Can AI agents check SPF automatically?

Yes. Agents can query DNS, inspect authentication results, and flag likely issues if they have live tooling. The risk is blind sending, so AI workflows should always check SPF, DKIM, DMARC, and blacklist status before campaigns go out.
Email deliverability issues are rarely random. They usually come from authentication, DNS, reputation, blacklist, or infrastructure signals, and SPF is one of the first places to check when mail starts missing the inbox. Run a live diagnostic, fix the sender list, and keep the policy aligned with what's sending.
Use mailX to run a free deliverability audit, check SPF alongside DKIM, DMARC, MX, SMTP, IMAP, and blacklist signals, and get plain-English fixes instead of raw DNS noise. It's a fast way to find out why emails are landing in spam and what needs to change next.

Most senders lose 30–70% of their emails to spam without knowing it.

Get a free expert audit of your domain, email authentication, and infrastructure. Identify hidden issues and fix them fast.

Book Your Free Deliverability Audit

CEO Mailwarm, email deliverability expert.