RFC 7208

SPF: Sender Policy Framework

SPF lists which servers are authorised to send email on behalf of your domain. Receivers check the inbound IP against your SPF record and accept or flag the message accordingly.

TL;DR

What it does

SPF answers the question 'is this server allowed to send mail as your domain?' by listing your authorised senders in DNS. Each receiving server resolves your SPF record at receive time and compares the sending IP to the list.

The result is a verdict: pass (IP is in the list), fail (explicitly excluded by -all), softfail (warned but accepted by ~all), or none (no SPF record).

Receivers feed the SPF result into their spam scoring and into DMARC alignment. SPF is the oldest of the three email-auth protocols (introduced 2003) and the easiest to set up.

How it works

  1. Publish a single TXT record on your domain starting with v=spf1.
  2. List authorised sources via mechanisms: ip4: for raw IPs, include: for outsourced senders (e.g. include:_spf.google.com for Google Workspace), a/mx for hosts in your A/MX records.
  3. End with a qualifier on the all mechanism: -all (hard fail), ~all (soft fail), ?all (neutral). Most domains use ~all.
  4. Receivers resolve the record at every inbound message; the result feeds both spam scoring and DMARC alignment.

Example record

yourdomain.com TXT

v=spf1 include:_spf.google.com include:sendgrid.net ~all

Common pitfalls

Related tools

Want PhishFence to monitor SPF for your domains?

Sign up free, add a domain, and PhishFence will continuously check SPF (and the rest of the email-auth stack) for you.

Start free