Sender Policy Framework meaning, in plain words

SPF declares which servers may send mail for your domain. What RFC 7208 says about the record and the 10-lookup limit, and why SPF alone is not enough.

Written by: Mio Kanzaki(Security Analyst (AI))Reviewed by: 千葉圭介Updated

SPF is a setting that declares which servers may send mail for your domain. The formal name is Sender Policy Framework, read letter by letter. RFC 7208 describes it as a mechanism by which the administrator of a domain publishes in DNS the machines allowed to send, and the receiving side compares against it.

How does SPF work?

Compare it with leaving at a company's reception a list of the delivery firms allowed to send out the company's parcels. The side receiving a parcel looks at the sender, and if the firm is not on the list, can judge it suspicious. What corresponds to the list in SPF is the declaration published in DNS.

The opening of RFC 7208 explains that, because the mail system sets no limit on what the sending machine claims, claims can be faked. SPF fills that hole with a declaration by the owner. What is checked is the claim within the mail delivery traffic, that is, HELO/EHLO and MAIL FROM. The From field shown in a mail program is not the direct target.

The declaration is published as a TXT record in DNS, in a form that starts with v=spf1. The result of a check has seven kinds, such as pass and fail. Ending the record with -all states clearly the intention not to allow sources that are not on the list. RFC 7208 says that otherwise the receiving side cannot judge with certainty.

There are two rules as well. One is not to place more than one SPF record on the same domain. The other is that there is a limit on the number of DNS lookups during a check, and going over 10 gives a permerror (treated as a configuration error). If you keep adding outside delivery services, it is easy to reach this limit.

Whether your mail declaration is in order can be checked using the way of looking in email authentication flaws. What is visible from outside can be seen with the free URL check.

Why does SPF matter?

Anyone can fake mail by merely claiming a sender. The MIC glossary explains that many junk mails and phishing mails spoof the email address. With SPF, the receiving mail server can check whether the mail came from a genuine server, and spoofed mail becomes easier to find.

SPF alone, however, does not protect the From field that the recipient sees. The preface of RFC 9989 says that SPF and DKIM are not directly tied to the domain in the From field. What joins the two is DMARC. The relation of the three is set out under DKIM and DMARC.

If you get the declaration wrong, even your own genuine mail comes under suspicion. Check whether newsletter services and contact forms are among your senders before you rewrite it. To go over the order of settings, contact us.

Related terms

  • DKIM: a setting that adds a digital signature to email so tampering can be checked
  • DMARC: a setting that tells receivers how to treat spoofed mail
  • SPF/DKIM/DMARC: the whole picture of anti-spoofing that combines the three
  • Email spoofing: the act of sending mail with a false sender

Frequently asked questions

If I set up only SPF, will spoofed mail be stopped?

It is not enough. RFC 9989 explains that SPF and DKIM are not directly tied to the domain in the From field that the recipient sees. Set up DMARC as well, which looks at the tie with the From field.

May I register more than one SPF record?

You must not place more than one SPF record on the same domain. RFC 7208 forbids a state in which multiple records are selected at each check. When you add a sender, add it to the one record.

Next step

Start by listing the senders of your mail. Your mail declaration can be reviewed using the method in email authentication flaws. The free URL check shows the public side only, and if you are unsure about the order of changes, contact us.

Frequently asked questions

If I set up only SPF, will spoofed mail be stopped?

It is not enough. RFC 9989 explains that SPF and DKIM are not directly tied to the domain in the From field that the recipient sees. Set up DMARC as well, which looks at the tie with the From field.

May I register more than one SPF record?

You must not place more than one SPF record on the same domain. RFC 7208 forbids a state in which multiple records are selected at each check. When you add a sender, add it to the one record.

See what an attacker can see, today

The free URL check returns a grade in under a minute. For costs and next steps, book a free consultation.