Christmas−30 % for 12 months with codeGet the offer →
  1. Home
  2. Glossary
  3. SPF

Updated

Definition

SPF: who may send email on your behalf

SPF is a DNS record that lists the servers authorised to send email for your domain name. Set up properly, it helps receiving mail services reject messages sent from servers you never declared.

  • Standard RFC 7208
  • One single TXT record
  • Free check
SPF, DKIM and DMARC checks on an incoming message in Passmundi
SPF: passauthorised server
SPF: failundeclared server

What is an SPF record?

SPF (Sender Policy Framework) is an email authentication standard defined in RFC 7208. In practice it is a DNS record of type TXT, published on your domain, which starts with v=spf1 and lists the servers allowed to send messages in your name: your mailbox provider, your invoicing software, your newsletter tool. Since February 2024, Gmail and Yahoo have required bulk senders (more than 5,000 messages a day to their users) to use SPF, DKIM and a DMARC policy, and Outlook.com has applied comparable requirements since May 2025.

How SPF works

The receiving server reads the envelope sender, announced during the SMTP exchange and later visible in the Return-Path header. It queries that domain's DNS and compares the sending IP address with the mechanisms: ip4 and ip6 for an address or a range, a and mx for servers already declared in DNS, include to pull in a provider's list. The final mechanism says what to do with everything else: -all (hard fail) or ~all (soft fail, accepted but suspicious).

The key point: SPF checks the envelope address, not the From address your recipient actually sees. A fraudster can pass SPF with their own domain while displaying yours. DMARC alignment is what closes that gap.

An SPF record example

For a small business sending from its MX servers, one fixed IP address and an email provider:

example.co.uk.  3600  IN  TXT  "v=spf1 mx ip4:203.0.113.25 include:spf.provider.example -all"

The domain's MX servers, the address 203.0.113.25 and the provider's servers are authorised. Any other server gets a fail.

Common mistakes

  • Two SPF records on the same domain: the standard allows only one, so the result becomes a permanent error (permerror).
  • More than 10 DNS lookups: every include, a, mx, exists or redirect uses one, nested includes included.
  • A forgotten sending service, whose messages fail without anyone understanding why.
  • A +all, which authorises any server at all, or a ptr mechanism, which the RFC discourages.
  • Assuming SPF is enough: without DKIM and DMARC the visible address can still be forged. Automatic forwarding also often breaks SPF, because the message leaves from a different server.

What Passmundi does

Passmundi checks the SPF of every incoming message, together with DKIM and DMARC. A message claiming to come from a known contact whose authentication fails is held back, with the reason shown. Your own SPF record does not change when you adopt Passmundi: it covers your outgoing mail, while Passmundi filters incoming mail through your MX records. To check yours, the free SPF, DKIM and DMARC checker gives you a score out of 100.

SPF

SPF key concepts

The mechanisms and settings you need to read or write an SPF record.

ip4 and ip6

Authorise a specific IP address or a whole range, with no extra DNS lookup.

a and mx

Authorise the servers already listed in the domain's A or MX records.

include

Pulls in a provider's SPF record, for a hosted mailbox service or a sending tool.

-all, the hard fail

Any server not listed fails. The strictest setting, to aim for once your list is complete.

~all, the soft fail

Unauthorised mail is accepted but flagged as suspicious, handy during a trial period.

10 DNS lookups at most

include, a, mx, exists and redirect each use one. Beyond that, SPF returns an error.

Setup

Set up or check your SPF in three steps

Changes are made with your DNS host, usually the company where you registered your domain name.

List every service that sends for you

Mailbox provider, website, invoicing software, newsletter tool, the copier that emails scans: note the IP address or include given by each vendor.

Publish one single TXT record

Put everything on one line starting with v=spf1 and ending with ~all during the trial period, then -all. Edit the existing record rather than adding a second one.

Test, then add DKIM and DMARC

The free checker reads your SPF, DKIM and DMARC and gives you a score out of 100. Then publish a DMARC policy to protect the visible From address.

Frequently asked questions

SPF: your questions

What is the difference between ~all and -all?

With -all, a server not listed gets a hard fail and the message may be rejected. With ~all it gets a soft fail: the message is usually accepted but treated as suspicious. Many organisations start with ~all and move to -all once every sending service has been declared.

Can a domain have two SPF records?

No. RFC 7208 allows only one record starting with v=spf1 per domain. With two, the result is a permanent error and SPF no longer protects anything. Merge the mechanisms into a single record.

What happens beyond 10 DNS lookups?

The check stops with a permanent error (permerror), which many servers treat as a failure. To stay under the limit, remove services you no longer use, prefer ip4 or ip6 when the address is fixed, and check what your providers' includes contain.

Does SPF on its own stop people spoofing my address?

No. SPF checks the envelope address, not the From address shown to the reader. You also need to sign your mail with DKIM and publish a DMARC policy, which requires one of the two checks to match the visible address.

Do I need to change my SPF record to use Passmundi?

No. Passmundi sits in front of your mailbox for incoming mail, via an MX change. Your SPF record describes the servers that send on your behalf, and those stay the same.

Does a domain that never sends email need SPF?

Yes, it is recommended. A record reading v=spf1 -all states that no server may send for this domain, which makes it less useful to fraudsters. Add a DMARC policy set to p=reject as well.

Is your SPF record set up correctly?

The free checker reads your SPF, DKIM and DMARC in a few seconds and gives you a score out of 100.