Skip to content
BENIBIX Learn

Sender Policy Framework (SPF)

Infrastructure🔒 SecurityEmail Authentication

Also known as SPF, SPF Record, Sender Policy Framework

A public list of who may send email for a domain.

Think of it like

It is like a list on the door of who may post letters for a house. Anyone else is turned away.

Example

A shop sends newsletters through an email service and receipts through its web shop. Its SPF record names both, so mail from either one passes.

Why it matters

Without it, anyone can send mail that claims to come from your domain. Big mail services now expect it from every bulk sender.

Definition

SPF is a list of the mail servers allowed to send email for a domain. The list is kept in the domain's DNS records, where anyone can read it. A mail server that gets an email checks the list. Mail from any other server looks fake. It stops people faking your domain on an email.

Example code

dns
example.com.  TXT  "v=spf1 include:_spf.google.com include:mailgun.org ~all"
One SPF record, as a line of text in DNS. It names two senders, and ~all marks mail from anyone else as suspect.
SPF is the first check: is this server on the list of allowed senders?

Common mistake

Forgetting to add a new email tool to the record. Its mail then fails the check and lands in spam.

Key takeaways

  1. 1
    A list of senders. Only these servers may send for you.
  2. 2
    Kept in DNS. Any mail server can read it.
  3. 3
    One record. Every sending tool goes in the same line.

Compare

Learn it properly