# Sender Policy Framework (SPF)

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

**Field:** Infrastructure  
**Category:** Security  
**Also known as:** SPF, SPF Record, Sender Policy Framework

## 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.

## 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

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.

## 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.

## 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.

## Common mistake

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

## Three principles

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

## Related terms

- [DomainKeys Identified Mail (DKIM)](https://learn.benibix.com/term/infrastructure/dkim)
- [Domain-based Message Authentication, Reporting and Conformance (DMARC)](https://learn.benibix.com/term/infrastructure/dmarc)
- [Domain Name System (DNS)](https://learn.benibix.com/term/infrastructure/dns)
- [Phishing](https://learn.benibix.com/term/infrastructure/phishing)
- [Email Deliverability](https://learn.benibix.com/term/marketing/email-deliverability)

## Told apart from

- [SPF vs DKIM](https://learn.benibix.com/compare/spf-vs-dkim): People think SPF and DKIM do the same check, and they do not. SPF asks if the server that sent the email is on the domain's list of allowed senders. DKIM checks a hidden signature on the email itself. It proves the email came from the domain and was not changed. Forwarding often breaks SPF but leaves DKIM whole.

## Taught in

- [SPF, DKIM and DMARC](https://learn.benibix.com/learn/marketing-email/spf-dkim-and-dmarc): Email Marketing, 10/11

![An email travels from a sender to a receiving mail server, which runs three checks against the sender's DNS records. SPF asks whether this server is on the list. DKIM checks the signature on the email against a public key. DMARC reads both results and the domain's rule, then sends the mail to the inbox, to spam or turns it away.](https://learn.benibix.com/diagrams/mkt-email-spf-dkim-dmarc.svg)

---

Source: https://learn.benibix.com/term/infrastructure/spf
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
