Glossary · Authentication
What is SPF?
SPF (Sender Policy Framework) is a DNS TXT record that lists the servers allowed to send email for a domain, so receiving servers can reject mail from anywhere else.
How SPF works
When a server receives a message, it looks up the SPF record of the domain in the message's return path (the envelope sender, also called MAIL FROM). If the sending server's IP address matches one of the mechanisms in the record, SPF passes.
An SPF record is a single TXT record at the domain:
v=spf1 include:_spf.google.com include:amazonses.com ~all
v=spf1marks it as SPF.include:authorises another domain's senders (for example Google Workspace or Amazon SES).ip4:/ip6:authorise specific addresses.~all(soft fail) or-all(hard fail) says what to do with everything else.
Common SPF mistakes
- More than one SPF record. A domain must have exactly one
v=spf1record; two records cause apermerror. - More than 10 DNS lookups. Each
include,a,mx,ptr,existsandredirectcounts. Going over 10 makes SPF fail. - Forgetting a sender. Every service that sends as your domain (helpdesk, CRM, newsletter tool) needs to be included.
SPF and DMARC
SPF alone doesn't protect the visible From address. DMARC requires SPF (or DKIM) to pass and align with the From domain.