SPF (Sender Policy Framework)
SPF is a DNS record that lists which mail servers are allowed to send email using your domain. Receivers use SPF to check whether mail comes from a server the domain allows. With DMARC, it's one of the two ways mail proves it really comes from the domain; without it, forged mail is harder to tell from real mail.
How SPF works
Sender Policy Framework (SPF, RFC 7208) is published as a DNS TXT record on your domain. When a receiving mail server gets a message claiming to be from your domain, it can read the SPF record and check whether the sending IP appears on your authorised list. If it doesn't, the receiver applies whatever policy your record's qualifier specifies.
The qualifier — the symbol before all at the end of the record — says what receivers should do with mail from a server that isn't listed. -all is a hard fail (the server is not allowed). ~all is a soft fail (probably not allowed; RFC 7208 says receivers should not reject on it alone). ?all is neutral (no opinion). +all authorizes every server on the internet, which is almost always a mistake. A domain that sends mail should end with ~all and enforce with DMARC: DMARC counts only an SPF pass, so ~all and -all give it the same answer, and RFC 7489 §10.1 warns that some receivers act on -all before DMARC runs, rejecting mail such as forwarded messages that DKIM would have passed. M3AAWG recommends ~all for domains that send mail for the same reason, and v=spf1 -all for domains that send none.
Domains that don't send email
A domain that never sends email still needs SPF. Parked, redirect-only and brand-protection domains look legitimate to recipients, and attackers pick them because nobody watches them. Publish three records: v=spf1 -all as SPF (no server may send for the domain), a null MX of 0 . (RFC 7505: the domain accepts no mail), and a DMARC record of v=DMARC1; p=reject (receivers reject anything claiming to come from it). Together they tell every receiver that mail from this domain is always forged.
SPF has a well-known limit: evaluating a record may trigger at most 10 DNS lookups (RFC 7208 §4.6.4). The include:, a, mx, ptr and exists mechanisms and the redirect= modifier each count, and so do the lookups inside every record an include: pulls in. Past the limit the check ends in a permanent error (PermError), which receivers and DMARC treat as a failure, so the record no longer protects the domain. If you use several SaaS providers (marketing, transactional, helpdesk) you can hit the limit quickly: remove senders you no longer use, or replace includes with the providers' IP ranges, which you then have to keep up to date.
SPF breaks when mail is forwarded. A mailing list or an auto-forward passes the message on from its own server, which isn't on your list, so SPF fails at the next receiver unless the forwarder rewrites the envelope sender. DKIM covers that case: it signs the message itself, so the signature survives forwarding. DMARC then asks receivers to require that SPF or DKIM passes for the domain in the From address. A complete setup uses all three.
How to fix it
Publish a v=spf1 record that lists your senders and ends with ~all.
A domain that sends no mail needs v=spf1 -all.
The 5 SPF checks Vendor Audit runs
Each check has a fixed set of results, and each result has one rating. These are the exact words the report uses.
SPF policy
Standard: RFC 7208
- PASSSPF says the domain sends no mail (v=spf1 -all)
- PASSSPF ends in -all
- PASSSPF ends in ~all — the recommended ending for a domain that sends mail
- CriticalSPF ends in +all — every server on the internet is authorized to send as this domain
- CriticalSPF not published — receivers have no list of servers allowed to send for this domain
- HighSPF neutral (?all) — no enforcement
- HighSPF record has no 'all' mechanism — no enforcement
- HighSPF redirect target has no 'all' mechanism — no enforcement
- HighSPF redirect target has no SPF record (broken redirect)
- LowSPF ends in -all — with DMARC, ~all is recommended: some receivers reject on SPF before DMARC runs
What it means. The record ends in
-all: mail from any server not listed fails SPF.Why it matters. RFC 7489 §10.1: some receivers check SPF before DMARC, so-allcan reject mail before DMARC runs, including forwarded mail that DKIM would have passed. DMARC counts only an SPF pass, so~allgives it the same answer without that risk.How to fix it. Change the ending to~alland let DMARC at quarantine or reject do the rejecting (M3AAWG's recommendation for a domain that sends mail). - LowSPF on a domain that sends no mail ends in ~all — it should be v=spf1 -all
What it means. The record lists no server that may send for the domain, and ends in
~all.Why it matters. A domain that sends no mail should say so firmly:-alltells receivers that every message claiming to come from it is forged.~allonly says it probably is, and receivers shouldn't reject on that alone.How to fix it. Publishv=spf1 -all(M3AAWG and GOV.UK guidance for domains that send no email). - InfoNo SPF on this subdomain, which sends no mail — spoofing is covered by the parent domain's DMARC policy
What it means. SPF lists the servers allowed to send mail for one exact name; subdomains don't inherit it.Why it matters. A subdomain that sends no mail rarely has its own SPF record. Its parent's DMARC policy still applies to it, and forged mail from the subdomain fails DMARC, so receivers quarantine or reject it.How to fix it. Nothing is required. To make the intent explicit, publish
v=spf1 -allon the subdomain.
SPF lookup count
Standard: RFC 7208 §4.6.4
What it checks. Evaluating an SPF record may trigger at most 10 DNS lookups, and the lookups inside included records count too: an include: whose record includes other domains in turn uses a lookup for each of them.
Why it matters. Past that limit receivers treat the record as broken, so SPF no longer stops anyone sending mail that claims to be from the domain.
How to fix it. Remove include: entries that are no longer used, or replace them with IP ranges. Check what each include: pulls in, since one provider's record often includes several more.
- PASSSPF lookup count within limit
- HighSPF needs more than 10 DNS lookups — receivers treat the record as broken (RFC 7208)
SPF single record
Standard: RFC 7208 §3.2
What it checks. A domain may publish only one TXT record that starts with v=spf1.
Why it matters. With two or more, receivers treat the domain as having no usable SPF, so mail forged in its name is no longer rejected on SPF.
How to fix it. Merge the records into one, keeping every sender they list.
- PASSOne SPF record published
- HighMore than one SPF record published — receivers treat SPF as broken
SPF mechanisms
Standard: RFC 7208 §4.6.4, §5.5
What it checks. Each name an SPF record looks up should exist, and the ptr mechanism should not be used.
Why it matters. An include: of a domain with no SPF record breaks the whole record, and more than two lookups that return nothing may make receivers give up; either way forged mail is no longer stopped by SPF. ptr is slow and unreliable.
How to fix it. Remove include:, a: and mx: entries for names that no longer exist, and replace ptr with ip4:, ip6: or include: entries.
- PASSSPF record has no empty lookups or deprecated mechanisms
- HighSPF includes a domain with no SPF record — receivers treat SPF as broken
- MediumSPF has more than two lookups that return nothing — receivers may treat it as broken
- LowSPF uses the deprecated ptr mechanism
SPF address ranges
Standard: RFC 7208 §5.6
What it checks. SPF's ip4: and ip6: terms list the addresses allowed to send mail for the domain.
Why it matters. A /8 is 16.7 million IPv4 addresses, and an IPv6 /32 is a whole provider's allocation. Mail from any of them passes SPF, so a typo or an over-generous range lets other people's servers send as the domain.
How to fix it. List only the addresses and providers that actually send the domain's mail; use the provider's include: instead of a wide range.
- PASSSPF authorizes no very wide address ranges
- LowSPF authorizes a very wide address range — millions of addresses may send as the domain
Related
DMARC · DKIM · MX records