Guide

SPF, DKIM and DMARC Explained in Plain English (With Examples)

By The GetDisposableMail team · Published · Updated · 7 min read

Cover for “SPF, DKIM and DMARC Explained”: an email passes through three checkpoint arches labelled SPF, DKIM and DMARC, each with a green tick

Email was designed in an era when everyone on the network trusted each other. Nothing in the original protocol stops a server from claiming to send mail “from” any domain it likes. SPF, DKIM and DMARC are the three standards that fix that, and today they decide whether your messages reach the inbox, land in spam or get rejected outright.

We operate a mail receiver for our temporary inboxes, so we see these checks from the receiving side every day. This is the explanation we wish we’d had when we started — no jargon you don’t need.

First: an email has two “from” addresses

Almost all confusion about email authentication comes from this. Every message carries:

  • The envelope sender (also called MAIL FROM, Return-Path or bounce address). It’s used by servers during delivery and is where bounces go. You rarely see it.
  • The header From — the address your mail app displays. This is what people trust, and what phishers forge.

SPF: who is allowed to send for a domain

Sender Policy Framework (RFC 7208) is a DNS record listing the servers allowed to send mail for a domain. A receiving server looks at the connecting server’s IP address and the envelope sender domain, fetches that domain’s SPF record and checks whether the IP is on the list.

A typical record, published as a TXT record on the domain, looks like this: v=spf1 include:_spf.your-email-provider.example ip4:203.0.113.10 -all. In words: “mail may come from my provider’s servers and from this one IP; anything else fails”.

SPF rules worth knowing

  • Only one SPF record per domain. Merge senders into it instead of adding a second.
  • SPF evaluation is limited to 10 DNS lookups (include, a, mx and similar mechanisms count). Exceed it and SPF returns an error.
  • -all means hard fail for unlisted senders; ~all is a soft fail. Most domains start with ~all while they discover all their senders.
  • SPF breaks when mail is forwarded, because the forwarding server isn’t on your list. That’s one reason DKIM matters.

DKIM: a signature that proves the message wasn’t altered

DomainKeys Identified Mail (RFC 6376) adds a cryptographic signature to each message. The sending server signs selected headers and the body with a private key and adds a DKIM-Signature header that names the signing domain (d=) and a selector (s=).

The receiver fetches the matching public key from DNS at selector._domainkey.yourdomain.example — a TXT record that looks like v=DKIM1; k=rsa; p=MIIBIjANBg… — and verifies the signature. If someone changed the message on the way, or forged it without the key, the check fails.

Because the signature travels with the message, DKIM usually survives forwarding, unlike SPF. Your email provider generates the keys; you publish the public key they give you.

DMARC: tying it to the address people actually see

SPF and DKIM on their own check *some* domain, not necessarily the one in the visible From line. A phisher can pass SPF for their own junk domain while displaying your brand in From. DMARC (RFC 7489) closes that gap with two ideas: alignment and policy.

Alignment

A message passes DMARC if SPF passes and the envelope domain matches the header From domain, or DKIM passes and the signing domain (d=) matches the header From domain. “Relaxed” alignment (the default) allows subdomains to match the organisational domain — mail.example.com aligns with example.com; “strict” requires an exact match.

Policy and reports

You publish DMARC as a TXT record at _dmarc.yourdomain.example, for example v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.example. The policy tells receivers what to do with mail that fails:

  • p=none — deliver as normal, but send me aggregate reports. Start here.
  • p=quarantine — treat failing mail as suspicious, typically the spam folder.
  • p=reject — refuse failing mail during delivery.

What Gmail and Yahoo now require

Since February 2024, Google’s email sender guidelines require all senders to personal Gmail accounts to set up SPF or DKIM, have valid forward and reverse DNS, use TLS, and keep reported spam rates below 0.3%. Senders of more than 5,000 messages a day to Gmail must also have SPF and DKIM, a DMARC record (p=none is acceptable), From-domain alignment, and one-click unsubscribe for marketing mail. Yahoo publishes similar sender best practices.

A quick checklist for your own domain

  1. List every service that sends as your domain: your mailbox provider, newsletter tool, app’s transactional email service, help desk, invoicing tool.
  2. Publish one SPF record that includes all of them, ending in ~all for now.
  3. Turn on DKIM signing in each service and publish the DNS records it gives you. Prefer DKIM with your own domain over the provider’s default.
  4. Publish DMARC with p=none and a reporting address. Read the reports for a few weeks to find senders you forgot.
  5. Fix alignment for each sender (usually by setting a custom return-path or DKIM domain), then move to p=quarantine and eventually p=reject.
  6. Send a test and inspect the result. In Gmail, “Show original” displays the SPF, DKIM and DMARC verdicts at the top.

Symptoms and likely causes

  • SPF: permerror — two SPF records, or more than 10 lookups.
  • SPF pass, DMARC fail — the envelope domain belongs to your provider, not you; rely on aligned DKIM or set a custom return-path.
  • DKIM fail after a footer was added — a mailing list or security gateway modified the body after signing.
  • Everything passes but mail goes to spam — authentication proves identity, not good behaviour. Look at content, complaint rates, list hygiene and sending volume spikes.

Why this matters even if you never send bulk email

If you own a domain and don’t send mail from it at all, you can still protect it: publish v=spf1 -all and a DMARC record with p=reject so nobody can send convincing mail pretending to be you. For everyone else, these records are what let receivers separate your real messages from the phishing that imitates them.

And if you’re building an app, test the result end to end. Sign up with a temporary inbox to check the verification email arrives quickly and renders properly — our testing guide shows a repeatable routine.

Frequently asked questions

Do I need SPF, DKIM and DMARC?

If you send email from your own domain, yes. Gmail requires all senders to personal Gmail accounts to use SPF or DKIM, and bulk senders (more than 5,000 messages a day to Gmail) to use SPF, DKIM and DMARC with alignment. Without them, mail is more likely to be rejected or sent to spam.

What does DMARC p=none do?

It tells receivers to take no special action on failing mail but to send you reports. It’s the right starting point: you learn which services send as your domain before you move to quarantine or reject.

Why does SPF pass but DMARC fail?

Usually alignment. SPF checks the envelope sender (Return-Path) domain, which is often your email provider’s domain. DMARC needs that domain — or the DKIM signing domain — to match the domain in the visible From address.

Can I have more than one SPF record?

No. A domain must have a single SPF record; multiple v=spf1 records cause an error. Combine all your senders into one record using include: mechanisms, and keep within the limit of 10 DNS lookups.

Does DMARC stop all phishing?

It stops exact-domain spoofing at receivers that enforce it, which is valuable. It does nothing against lookalike domains or compromised real accounts, so users still need to check links and senders.

Do temporary email services check SPF, DKIM and DMARC?

Receivers can, and many do. Either way, a disposable inbox is a quick way to confirm your app’s emails actually arrive and render — see our guide to testing sign-up emails.

Sources and further reading

About the author. The GetDisposableMail team builds and runs this temporary email service. We write these guides from what we see operating a live disposable inbox, and we review them when the service changes. More about us.