What SPF does
SPF defines which servers may send mail with your domain as the sender. Receivers can tell mail that comes from servers of strangers.
How it works
SPF (Sender Policy Framework) is an entry in the DNS of your domain, a so-called TXT record. It lists the servers that may send mail in your name. When a mail arrives, the receiver compares the address of the delivering server with this list.
A simple record looks like this:
v=spf1 mx include:_spf.your-newsletter-provider.example ~all
mxallows the mail servers of your domain.include:adopts the list of a service you send through, such as a newsletter tool, a shop or a CRM.ip4:andip6:allow single addresses or networks.~allat the end says: everything else is suspicious.-allsays: reject everything else.
What matters
- Exactly one SPF record. Two records make SPF invalid. Merge several into one.
- At most 10 DNS lookups. Every
include,a,mxandredirectcosts a lookup, nested ones count too. Remove services you no longer use. - A clear ending. With
+allor withoutallthe record protects nothing. - Every sending path. Invoices from the shop, tickets from the helpdesk and website forms often send through their own servers.
How to set it up
- Collect all systems that send with your domain as the sender.
- Add the entry each provider names, all together in one TXT record right at your domain. You do this in the DNS settings at your domain provider, or your agency does it.
- Start with
~all. Switch to-allonce the DMARC reports have shown no own mails as failing for a few weeks.