Cybersecurity
What is SPF?
Also called Sender Policy Framework, SPF record.
Short definition
SPF (Sender Policy Framework) is a DNS record that lists which servers are allowed to send email on behalf of a company's domain, so receiving servers can reject or flag email from other servers.
How it works
The domain owner adds a single TXT record to DNS that starts with v=spf1 and lists the legitimate sending servers or services, such as the office email service and the newsletter app. When an email arrives, the receiving server checks the sender's IP address against that list. If it does not match, the SPF record also states what should be done, from simply flagging the message to rejecting it.
Limits to understand
SPF checks the technical sender address behind the scenes, not the From address the recipient reads in the inbox. Fraudsters can still display your company address in the From field if only SPF is in place. That is why SPF is deployed together with DKIM and DMARC. SPF can also fail when email is forwarded by another server, because the sending IP address changes.
Common mistakes
A domain has two SPF records at once, when only one is valid. A new sending service, such as a billing app, is not added, so its invoices land in the spam folder. A list that is too long exceeds the DNS lookup limit set by the standard, so the check fails. Review the SPF record whenever you add or retire an email service. Also keep a record of who manages the domain's DNS, because SPF changes can only be made by whoever holds that access.
Resources
- RFC 7208: Sender Policy Framework (SPF) (rfc-editor.org)
- Cloudflare Learning: What is a DNS SPF record? (cloudflare.com)