Skip to main content

AWS Glossary

SPF

Sender Policy Framework — DNS TXT record listing which hosts may send mail for a domain; limited to 10 DNS lookups.

Last reviewed: July 2026

Definition

SPF (Sender Policy Framework) is a DNS TXT record on a domain (or MAIL FROM domain) that lists which IP addresses / includes are authorized to send mail for that domain. Receivers check the SMTP envelope sender (Return-Path) against SPF. Common mechanisms include ip4:, ip6:, include:, and a/mx.

When to use it

  • Every sending domain and custom MAIL FROM domain used with Amazon SES or any ESP
  • As one leg of DMARC (alongside DKIM) for bulk-sender compliance

When not to use it

  • Flattening dozens of vendor includes into a single static IP list you never update — breaks when vendors rotate
  • Relying on SPF alone for brand protection — DMARC + DKIM are required for modern bulk rules

Tips

  • Stay under the 10 DNS lookup limit (include, a, mx, redirect, and exists count)
  • Prefer SES custom MAIL FROM so SPF authenticates a domain you control and can align for DMARC
  • Use ~all (softfail) or -all (fail) intentionally; softfail is common during migration

Gotchas

Serious

  • Lookup limit exceeded → SPF PermError → DMARC alignment fails even if “you included everyone”
  • Publishing SPF on the organizational domain but sending with a Return-Path that never matches

Regular

  • Multiple SPF TXT records on the same name (invalid) instead of one merged record

Need help with this topic?

Our AWS-certified team implements, audits, and optimizes these services in production — from Bedrock RAG pipelines to multi-account landing zones.