Sender Policy Framework (SPF) is an email authentication technique used for mitigating cyber threats by helping the user detect email forging and spoofing. Recipient email servers evaluate SPF using the domain specified in the MAIL FROM address (commonly referred to as the Return-Path). A Return-Path is the email address used by recipient email servers to notify the sender of any delivery problems. If an email fails to deliver, bounce messages are sent to the Return-Path address.
The SPF record retrieved by the recipient email server will include a list of approved IP addresses that are permitted to send an email for the sender’s domain. The email server will compare the IP address of the received email to the retrieved list. If it matches, the email passes SPF authentication. If not, the email may very well be fraudulent.
A domain can have only one SPF record
Publishing multiple SPF records will cause SPF validation to fail
If an SPF record already exists, it must be updated, not recreated
Use this method only if no SPF record exists for your domain.
Log in to your DNS provider
Create a new TXT record
Enter the following values:
Host / Name: @ (or your domain name)
Record Type: TXT
Value (example): v=spf1 include:_spf.google.com -all
Use this method if an SPF record is already present.
Locate the existing TXT record starting with: v=spf1
Modify/Edit the same record by adding required sending sources.
Example (Update Existing Record):
v=spf1 include:_spf.google.com -all
How to Achieve SPF Alignment?
Setting a custom Return-Path has many advantages. If a DMARC policy has been implemented for your domain, it is strongly recommended to set up a custom Return-Path for achieving SPF alignment. DMARC evaluates whether the domain in the Return-Path aligns with the domain in the ‘From’ address. If it doesn’t, that email will fail SPF alignment authentication.
For instance, if your organization sends emails from example.com, you can still pass DKIM and SPF authentication; however, if the “From” and Return-Path addresses don’t use the same domain, SPF won’t pass for DMARC verification. When the Return-Path domain tdmarc.example.com is set up and emails are sent from example.com, your domains are aligned for DMARC to operate. This configuration sets the MAIL FROM (Return-Path) domain to tdmarc.example.com
Relaxed SPF Alignment (aspf=r)
Strict SPF Alignment (aspf=s)