Vendor Audit

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

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.

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.

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.

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.

Related

DMARC · DKIM · MX records