Skip to content
DMARC Pulse

Learn

What is SPF in Email? How an SPF Check Works

What is SPF in email? A DNS record listing the servers allowed to send for your domain. How the check works, an example record and common mistakes.

What it is

SPF (Sender Policy Framework) is an email authentication method that lets a domain list, in DNS, the servers allowed to send mail using its name. What is SPF used for? A receiving server compares the IP address delivering a message with that list and determines whether the server was authorized.

What is an SPF record for email?

An SPF record is a DNS TXT record that starts with v=spf1. Mechanisms (tests against the sending server) follow, normally closed by all for everything not matched earlier. A name can have only one SPF record, and subdomains do not inherit it. The SPF record syntax reference covers each mechanism.

How an SPF check works

  1. The sending server names an envelope sender with the SMTP MAIL FROM command. Bounces go to that address. Readers do not see it, and it can differ from the visible From address.
  2. The receiving server takes the domain of that address and looks up its TXT records in DNS, keeping the one that starts with v=spf1.
  3. It tests the sending IP address against the mechanisms from left to right and stops at the first match.
  4. The qualifier on that mechanism sets the result: + gives pass (the default with no sign), - gives fail, ~ gives softfail and ? gives neutral. With no match and no redirect, the result is neutral.
  5. The receiver applies its own policy and can record the result in the message header.

The other possible results are none (no record or no usable domain), temperror (a temporary error, generally in DNS) and permerror (a record that cannot be interpreted). RFC 7208 sets no comprehensive rule for handling each result and leaves fail to local policy. It does say a neutral result must be treated like none, and that a softfail alone should not cause rejection. See how fail and softfail differ.

What SPF does not cover

SPF checks the envelope domain, so the From address people read can still be forged. RFC 7208 warns that a sender can pass SPF with its own domain and list a different identity in the header. DMARC, the policy built on SPF and DKIM, counts the MAIL FROM check only when that domain aligns with the From domain.

Forwarding is the other limit. SPF looks at the last sending server, so mail relayed with its original MAIL FROM usually fails. DKIM (a signature on the message) generally stays valid in that case.

Do you need an SPF record?

Google and Yahoo require SPF or DKIM from everyone sending to personal Gmail accounts and Yahoo mailboxes, and both from bulk senders. Google's FAQ defines a bulk sender as one sending close to 5,000 messages or more to personal Gmail accounts within 24 hours. Microsoft requires domains sending more than 5,000 emails a day to Outlook.com, Hotmail and Live addresses to pass SPF and DKIM and to publish a DMARC record.

Example

A company sends staff mail through Google Workspace and invoices from its own server at 203.0.113.25. It publishes one TXT record at example.com:

TXT
v=spf1 ip4:203.0.113.25 include:_spf.google.com ~all

include:_spf.google.com is the value Google publishes for Workspace. Here is what a receiver concludes when the MAIL FROM domain is example.com:

Mail delivered by Term that matches Result
203.0.113.25 ip4:203.0.113.25 pass
A server in Google's SPF record include:_spf.google.com pass
198.51.100.7 ~all softfail

RFC 7208 recommends recording the result in the message header, in forms such as this one:

Authentication-Results: myhost.example.org; spf=pass
  smtp.mailfrom=example.com

To draft a record for your own senders, use the SPF generator.

Common mistakes

  • Adding a second v=spf1 record. Two records on one name return permerror on every check. To add a sender, edit the record you have. Merge duplicates into one and keep every sender.
  • Moving to -all too early. Caution: any server you forgot gets fail, and receivers may reject its mail. RFC 9989, the current DMARC specification, warns that this can happen before DMARC runs. Even a message with an aligned DKIM signature can be refused, and it will not appear in DMARC aggregate reports. First, keep ~all, publish a DMARC record at p=none with a rua address, and review the aggregate reports until you have seen every real sender.
  • Going past 10 DNS lookups. include, a, mx, ptr, exists and redirect count, even inside included records. Past 10, the result is permerror. See how to fix too many lookups.
  • Adding include: for a service that uses its own envelope domain. Receivers check the MAIL FROM domain, so that include: is never read for the service's mail and SPF cannot align with your From domain. Where the service allows it, use a MAIL FROM on your domain or sign with DKIM for your domain. Before removing one, check the Return-Path of a message from that service: if it shows your domain, the include: is in use.

Check it now

Validate SPF and count DNS lookups

Frequently asked questions

What does SPF stand for in email?
Sender Policy Framework. RFC 7208, published in April 2014, defines version 1 and replaced RFC 4408.
Does SPF stop email spoofing?
Only in part. SPF checks whether a server may use the domain in the envelope MAIL FROM address, which readers do not see. A forged From address can still arrive if the sender uses its own domain in the envelope. DMARC addresses this by counting an SPF pass only when that domain aligns with the From domain.
Is SPF enough on its own?
No. Microsoft says SPF alone is not enough and recommends DKIM and DMARC as well. RFC 9989 recommends using both SPF and DKIM with DMARC, and says a domain publishing p=reject must not rely on SPF alone.
Should a domain that sends no email have an SPF record?
Yes. RFC 7208 calls this a well-established best practice and gives the record v=spf1 -all. Microsoft documents the same record for parked domains. Publish it only on a domain that really sends no mail, because it gives every sender a fail result.
How long does a new SPF record take to work?
Google's setup guide says it can take up to 48 hours for SPF authentication to start working. When you change a record, RFC 7208 advises a transition period so the old policy stays valid until mail already in transit has been checked.

Sources consulted

RFC 7208 §4.6.2 Mechanisms
checked 2026-11-08
RFC 7208 §5.1 all
checked 2026-11-08
RFC 7208 §5.2 include
checked 2026-11-08
RFC 7208 §8 Result Handling
checked 2026-11-08
RFC 7208 §8.2 Neutral
checked 2026-11-08
RFC 7208 §8.4 Fail
checked 2026-11-08
RFC 7208 §8.5 Softfail
checked 2026-11-08
RFC 7208 §10.3 Mediators
checked 2026-11-08

Related pages

Keep it healthy

Know the moment something breaks

Point your DMARC reports to DMARC Pulse and see who sends email as your domain, what fails and why — with a calm alert when anything changes.

Free plan: 1 domain, no credit card.