# SPF, DKIM and DMARC in plain English

> What do SPF, DKIM and DMARC actually do, and which one stops someone spoofing my domain?

Canonical: https://www.wovu.dev/guides/spf-dkim-dmarc-explained/ (updated 2026-11-08)

SPF lists the servers allowed to send mail for your domain, DKIM signs each message so a receiver can check it was not altered, and DMARC tells the receiver what to do when neither check aligns with your domain. Only DMARC can instruct a receiver to reject a spoofed message; SPF and DKIM are inputs to that decision.

The three are usually mentioned together because they solve one problem in three layers. SPF authenticates the sending infrastructure. DKIM authenticates the message. DMARC ties both to the domain the recipient actually sees, and adds reporting.

## The envelope, the letter and the seal

A useful analogy:

- **SPF** is the return address on the envelope. It says which post offices are allowed to send on your behalf.
- **DKIM** is a wax seal on the letter. It proves the letter was sealed by someone holding your private key and was not changed in transit.
- **DMARC** is the instruction on the envelope that says what to do if the return address and the seal do not match the name you print on the front.

The analogy breaks in one important way: SPF checks an address the recipient usually never sees (the envelope sender, or `MAIL FROM`), while the recipient sees the `From:` header. That gap is why alignment exists.

## What SPF does

SPF is published as a DNS TXT record at the domain level:

```txt
example.com.  TXT  "v=spf1 include:_spf.google.com -all"
```

A receiver looks up the connecting IP and checks whether it matches one of the mechanisms in the record. Common mechanisms:

- `include:` pulls in another domain's SPF record, usually a provider such as Google, Microsoft or your email platform.
- `a` and `mx` authorise the domain's own address and mail servers.
- `ip4:` and `ip6:` authorise literal addresses.
- `all` is the catch-all, and the qualifier in front of it sets the result: `-all` fails, `~all` soft-fails, `?all` is neutral, `+all` passes everyone.

Two rules matter more than the rest. There must be exactly one SPF record per domain. And the record must resolve within 10 DNS lookups; exceeding that is a permanent error.

SPF has a structural weakness: it authenticates the envelope sender, not the visible `From:` header. A forwarding service can break it, and a domain can pass SPF for an IP while still showing a different domain to the reader. That is what DKIM and DMARC fix.

## What DKIM does

DKIM adds a signature header to the message. The signer holds a private key; the public key is published in DNS at a selector, for example:

```txt
selector1._domainkey.example.com.  TXT  "v=DKIM1; k=rsa; p=MIIBIjANBg..."
```

The receiver uses the public key to verify that the signed headers and body have not changed. The signature survives forwarding better than SPF because it travels with the message.

The selector is the part that makes rotation possible. You can publish a new key at a new selector, start signing with it, and remove the old one after the mail has settled. A missing or empty `p=` tag means the key has been revoked.

DKIM does not say "this domain is allowed to send". It says "whoever signed this had the private key for this selector". That is why DMARC also checks alignment: the signing domain (`d=`) should match the `From:` domain.

## What DMARC does

DMARC is published at `_dmarc.example.com`:

```txt
_dmarc.example.com.  TXT  "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com; pct=100"
```

It tells the receiver:

- `p=` what to do when a message fails both SPF and DKIM alignment: `none`, `quarantine` or `reject`.
- `rua=` where to send aggregate reports.
- `pct=` what percentage of failing mail the policy applies to.
- `adkim=` and `aspf=` whether alignment is strict or relaxed.

DMARC passes only when at least one of SPF or DKIM passes **and** aligns with the `From:` domain. This is the part people miss. A message can pass SPF and still fail DMARC because the SPF domain is a sending platform, not your domain. A message can pass DKIM and still fail DMARC because the signing domain is different.

## Which one stops spoofing?

Only DMARC does, and only at `p=quarantine` or `p=reject`. At `p=none` you are asking for reports, not protection. That is a useful stage, not a destination.

SPF and DKIM on their own reduce forgery, but a receiver has no instruction to act. A spoofed message can pass neither check and still land in the inbox if the receiver decides it looks legitimate.

## The order to fix things

1. Publish SPF, with one record and a correct `-all` or `~all`.
2. Publish DKIM for every service that sends for you, and confirm the selector.
3. Publish DMARC at `p=none` with a reporting address.
4. Read the reports for a few weeks and find every legitimate sender.
5. Move to `p=quarantine`, then `p=reject`, when the reports are clean.

Use the [SPF, DKIM and DMARC checker](/tools/spf-dkim-dmarc-checker/) to see what is currently published. A record being present is not the same as alignment working, so send a test message and read the authentication headers as well.

## FAQ

### Do I need all three?

Yes, in practice. SPF and DKIM are the evidence; DMARC is the policy. Without DMARC, a receiver has no instruction to reject a message that fails both.

### Does passing SPF mean DMARC will pass?

Not necessarily. SPF must align with the `From:` domain. If the envelope sender is a sending platform and the visible `From:` is your domain, relaxed alignment may still fail.

### Is DMARC required by Google and Yahoo?

Both publish sender requirements for bulk senders that include authentication and a DMARC record. Check the current [Google guidelines](https://support.google.com/a/answer/81126) and [Yahoo best practices](https://senders.yahooinc.com/best-practices/) for the thresholds that apply to you.

### Can DMARC break my email?

Yes, if you move to quarantine or reject before you know every legitimate sender. Start at `p=none`, collect reports, and only then tighten the policy.

## Sources checked 2026-11-08

- [RFC 7208, Sender Policy Framework](https://www.rfc-editor.org/rfc/rfc7208)
- [RFC 6376, DomainKeys Identified Mail](https://www.rfc-editor.org/rfc/rfc6376)
- [RFC 7489, DMARC](https://www.rfc-editor.org/rfc/rfc7489)
- [Google Workspace email sender guidelines](https://support.google.com/a/answer/81126)
- [DMARC.org overview](https://dmarc.org/overview/)
