On this page
- What SPF, DKIM and DMARC do
- How SPF, DKIM and DMARC work together
- Alignment: why SPF and DKIM can pass and DMARC still fail
- SPF vs DKIM vs DMARC: what each one does that the others don't
- Which one do I need?
- Setup per sending service: SPF, DKIM, return path and DMARC for nine services
- How to check that SPF, DKIM and DMARC are working
- Setup order: how to use SPF, DKIM and DMARC together
- FAQ
SPF, DKIM and DMARC Explained
SPF lists which servers may send mail for your domain, DKIM adds a signature receivers can verify, and DMARC tells receivers what to do when neither lines up with your From address. You need SPF and DKIM in place, and DMARC on top.
Sender Policy Framework, DomainKeys Identified Mail and Domain-based Message Authentication, Reporting and Conformance sound like one thing and are three. This page covers how they fit together, why they can pass and still fail, which ones you need, and what SendGrid, Amazon SES, Mailgun, Postmark, Resend, Mailtrap and three more set up for you, from their own docs.
Key takeaways
- SPF checks the sending server, DKIM checks a signature on the message, and DMARC checks that one of them passed for your From domain, then applies your policy.
- DMARC passes when SPF or DKIM passes with a domain aligned to the From domain (RFC 9989 §4.1, §4.4). In practice set up both, because each breaks in cases the other survives.
- SPF and DKIM can both pass while DMARC fails. With services whose default return path or DKIM signature uses the service's own domain, they can pass for the service's domain while none matches yours.
- Only you can publish DMARC. Services differ in what they set up for SPF and DKIM, and the table below lists nine from their own docs.
- Start DMARC at
p=none, read the reports, then tighten.
What SPF, DKIM and DMARC do
SPF, DKIM and DMARC are three DNS-based checks that answer three different questions: which server sent this, was the message signed by the domain, and does that domain match the From address the reader sees. All three are covered, with the other standards, in what email authentication is.
| Protocol | Full name | What it checks | Where it lives | Protects against |
|---|---|---|---|---|
| SPF | Sender Policy Framework | That the sending server's IP is allowed by the domain in the message's return path (envelope sender) | A TXT record on the domain; some services use a CNAME on a return-path subdomain instead | Mail sent from servers the domain never authorized |
| DKIM | DomainKeys Identified Mail | That a signature on the message verifies against the public key published by the signing domain | A record at selector._domainkey.<domain>, usually a TXT; some services publish it as a CNAME |
Messages forged or changed after signing |
| DMARC | Domain-based Message Authentication, Reporting and Conformance | That SPF or DKIM passed on a domain aligned with the visible From domain, then applies your policy and sends reports | A TXT record at _dmarc.<domain> |
Spoofing of the From address you show readers |
How SPF, DKIM and DMARC work together
When a message arrives, the receiving server checks SPF, DKIM and DMARC, and the order varies by receiver (RFC 9989 §7.1). A typical sequence has five steps:
- The mail arrives. The receiver notes the sending IP, the return-path domain (the envelope sender) and the From domain in the headers.
- SPF is checked against the return-path domain and the sending IP.
- The DKIM signature is checked, using the signing domain and selector named in the signature.
- DMARC checks alignment. Did SPF or DKIM pass on a domain that matches the From domain?
- The policy is applied.
none,quarantineorrejectas published, and aggregate reports go to the address in your record.
Two worked examples for example.com, written for illustration, not taken from a real message:
| Case | SPF | DKIM | DMARC |
|---|---|---|---|
Pass. Your service signs with d=example.com, and a recipient forwards the message |
Fails: the forwarder's server isn't in your record | Passes, signed by example.com, aligned with the From domain |
Passes, because one aligned result is enough |
Fail. The service uses its own return-path and signing domain (mail.vendor.example) and you set up nothing more |
Passes, but for mail.vendor.example |
Passes, but signed by mail.vendor.example |
Fails: neither passing domain matches example.com |
The second row is a common trap with services that default to their own domain, and the next section explains it.
Alignment: why SPF and DKIM can pass and DMARC still fail
Alignment means the domain that SPF or DKIM authenticated must match the domain in the visible From address. DMARC does not just ask whether SPF or DKIM passed. It asks whether they passed for your domain. This section owns the concept; the tags that control it are in the DMARC record guide, and error messages are in fixing SPF, DKIM and DMARC failures.
Two modes exist, set by the aspf and adkim tags, and relaxed is the default in RFC 9989:
- Relaxed: the authenticated domain and the From domain only need to share the same organizational domain, so
mail.example.comaligns withexample.com. - Strict: the two must be an exact match.
With services whose default return path or DKIM signature uses the service's own domain (Postmark's default return path, Amazon SES's default MAIL FROM), nothing aligns until you add your own records; SendGrid, Resend, Mailtrap and MailerSend set the return path at your domain as part of setup (see the table below). Postmark's docs (checked November 2026) say that with the default return path at the vendor's domain, SPF can't align until you set a custom return path, and strict SPF alignment (aspf=s) can't pass with Postmark's return path on a subdomain. Mailjet's docs say strict SPF alignment fails with its default return path. The DMARC pass rule and both alignment modes are unchanged in RFC 9989, the current DMARC standard (May 2026), which replaced RFC 7489, the version most guides still quote.
SPF vs DKIM vs DMARC: what each one does that the others don't
SPF checks the sending server, DKIM checks the message, and DMARC checks both against the From address and tells receivers what to do. They are layers, not alternatives. The table sets them side by side.
| Protocol | What it verifies | Address it looks at | Survives forwarding | Set up by | Reports | Fails when | In one line |
|---|---|---|---|---|---|---|---|
| SPF (RFC 7208) | The sending server's IP is allowed | Envelope sender (return path) | Often not: the forwarder's server isn't in your record | You publish; the service gives you the value | No aggregate reports | Sent from an unlisted server; more than one SPF record; more than 10 lookups | "Who may send" |
| DKIM (RFC 6376) | The message is signed and unchanged | The signing domain (d=) |
Usually, if the message isn't changed | The service signs; you publish the key records | No aggregate reports | The key record is missing or wrong; the body or signed headers were altered | "Was it signed" |
| DMARC (RFC 9989) | SPF or DKIM passed on a domain aligned with From | The visible From domain | Passes if either aligned result survives | You, only | Yes: aggregate reports to your rua address (RFC 9990) |
Neither SPF nor DKIM passes with alignment | "What to do about it" |
On forwarding, we stay with what the RFCs support. Forwarding sends your message from the forwarder's server, which isn't in your SPF record, so SPF often fails at the final receiver; DKIM signatures usually survive if the message isn't changed (RFC 7208 §10.3 and RFC 6376). The SPF failure modes in the table are the ones in RFC 7208: one record per domain, and a 10-lookup limit (§4.6.4), detailed on the SPF record page.
Which one do I need?
Set up all three, in this order: SPF and DKIM first, DMARC on top. DMARC itself only needs SPF or DKIM to pass with alignment, so it doesn't strictly require both. But each one fails where the other holds, and the mailbox providers now ask for both.
- SPF alone is not enough because it often fails when mail is forwarded.
- DKIM alone is not enough for bulk senders: Google and Yahoo both require SPF and DKIM from bulk senders, plus a DMARC record of at least
p=none(checked November 2026). Google asks only SPF or DKIM from everyone else. - DMARC alone does nothing. It is a policy on top of the other two.
The provider thresholds and dates are on the Gmail, Yahoo and Microsoft requirements summary (the full guide is Gmail and Yahoo bulk sender requirements). When you publish DMARC, start at p=none and tighten later; the rollout is in the DMARC policy guide.
Setup per sending service: SPF, DKIM, return path and DMARC for nine services
None of the nine services sets up everything for you, because DMARC always lives at your domain. The table lists what each one gives you, from each service's own docs and product pages, checked November 2026. Order is fixed and not a ranking.
| Service | SPF | DKIM | Return path at your domain | DMARC help | DNS records at setup | Docs |
|---|---|---|---|---|---|---|
| SendGrid | Covered by the return-path CNAME (automated security on); include:sendgrid.net TXT if off |
2 CNAMEs (s1/s2._domainkey), SendGrid holds and rotates the keys; or 1 TXT you manage |
Yes, by default (CNAME on an em subdomain, label editable) |
Suggests a p=none record; Valimail partnership |
4 (3 CNAME + DMARC TXT) | SendGrid domain authentication |
| Amazon SES | Implicit (default MAIL FROM is an amazonses.com subdomain); custom MAIL FROM adds include:amazonses.com |
Easy DKIM: 3 CNAMEs, SES holds the keys (2048-bit default); or bring your own key (1 TXT) | Opt-in: custom MAIL FROM subdomain (1 MX + 1 TXT) | Guide only | 3 CNAME (+2 for custom MAIL FROM) | Amazon SES email authentication |
| Mailgun | include:mailgun.org in the SPF record of your sending domain |
2 CNAMEs (pdk1/pdk2._domainkey), Mailgun rotates every 120 days by default; or 1 TXT |
Not stated (SPF and MX records go on your sending domain or subdomain) | Guide; aggregate reports via Red Sift on paid plans | 5 (2 TXT, 2 MX, 1 CNAME); 6 with automatic DKIM | Mailgun domain verification |
| Postmark | Covered by the custom Return-Path CNAME; root include not needed for alignment | 1 TXT (…pm._domainkey), 1024-bit; you trigger rotation by API |
Opt-in: 1 CNAME to pm.mtasv.net |
Free weekly DMARC Digests; paid version $14/month per domain | 2 (DKIM TXT + Return-Path CNAME) | Postmark domain setup |
| Resend | MX + SPF TXT (include:amazonses.com) on the send. subdomain |
1 TXT (resend._domainkey), 1024-bit, not rotated |
Yes, by default (send. subdomain, name set only at creation) |
Guide + free open-source DMARC Analyzer | 3 (DKIM TXT, MX, SPF TXT) | Resend domains |
| Mailtrap | Covered by the verification CNAME; no separate SPF record | 2 CNAMEs (rwmt1/rwmt2._domainkey), Mailtrap holds the keys, rotated monthly |
Yes, automatic per domain | Suggests a p=none record with reports to a Mailtrap address |
5 (4 CNAME + DMARC TXT) | Mailtrap sending domain setup |
| Brevo | No SPF record needed on shared IPs; branded-subdomain CNAME optional | 2 CNAMEs (brevo1/brevo2._domainkey, 2048-bit, rotated by Brevo) or 1 TXT (1024-bit) |
Opt-in on shared IPs (branded subdomain CNAME) | Adds a p=none record with reports to Brevo |
3–4 (code TXT, DKIM, DMARC) | Brevo domain authentication |
| Mailjet | include:spf.mailjet.com in your root SPF |
1 TXT (mailjet._domainkey), 2048-bit default; rotation not documented |
Opt-in on paid plans (CNAME + support ticket) | Guide only | 2 (SPF TXT + DKIM TXT) + domain validation | Mailjet SPF and DKIM |
| MailerSend | SPF TXT with include:_spf.mailersend.net (merged into one record) |
2 CNAMEs, 2048-bit; rotation not documented | Yes, part of setup (CNAME on mta.) |
DMARC monitoring tool (30 days free on Starter, then add-on) | 4 (SPF TXT, 2 DKIM CNAME, return-path CNAME) | MailerSend domain verification |
From each service's own docs and product pages, checked November 2026. "Not documented" means we didn't find it in the vendor's docs. Mailtrap's monthly rotation and automatic return path come from its product page and blog, not its docs. A service can sign and send for you, but only you can publish a DMARC record at your own domain. Postmark DMARC Digests price: Postmark's DMARC FAQ, checked November 2026.
What the table shows, and what it doesn't:
- Fewest records. Counted from the docs, Postmark and Mailjet list two DNS records at setup (Mailjet also asks for domain validation). The counts aren't like for like: SendGrid's, Mailtrap's and Brevo's include a suggested DMARC record, which you need anyway. A count is not effort, and we make no "simplest" claim.
- Automatic DKIM rotation. The table lists what each doc says: Mailgun rotates every 120 days by default, Mailtrap monthly (its site says), Brevo automatically with CNAMEs, and SendGrid automatically with automated security (interval not stated). Postmark has you trigger it by API, Resend doesn't rotate, and Amazon SES (Easy DKIM), Mailjet and MailerSend are not documented. Key length and rotation advice are on the DKIM page.
For sending-side results, see the deliverability section of our ranking.
How to check that SPF, DKIM and DMARC are working
Send a message from your domain to a mailbox you control and read its Authentication-Results header (RFC 8601). If SPF and DKIM say pass and DMARC says fail, you are in the alignment trap above. Step-by-step checks are on the SPF record and what is DKIM pages; if a check fails, go to fixing SPF, DKIM and DMARC failures.
Setup order: how to use SPF, DKIM and DMARC together
Use the three in four steps:
- Set up SPF and DKIM at your sending service. Follow its docs and publish the records it gives you; the table above shows what to expect. Details: SPF record and what is DKIM.
- Check alignment. Make sure the return-path or signing domain is yours, not the service's.
- Publish DMARC at
p=nonewith reports. The record is shown below. - Read the reports, then tighten. Move to
quarantineorrejectwhen legitimate mail all aligns. See DMARC policy and DMARC reports.
Example for example.com, step 3:
Host _dmarc.example.com, value:
v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com
Every page in the cluster: what email authentication is, SPF record, what is DKIM, what is DMARC, DMARC record, DMARC policy, how to set up DMARC, DMARC reports, BIMI and MTA-STS.
SPF, DKIM and DMARC: FAQ
What does SPF, DKIM and DMARC stand for?
SPF is Sender Policy Framework, DKIM is DomainKeys Identified Mail, and DMARC is Domain-based Message Authentication, Reporting and Conformance. SPF lists the servers allowed to send for a domain, DKIM signs the message, and DMARC sets what receivers do when neither SPF nor DKIM passes with an aligned domain. See what they do.
Do I need SPF, DKIM and DMARC all together?
In practice yes. DMARC passes when either SPF or DKIM passes with alignment, so it doesn't strictly need both. But SPF often fails on forwarded mail, and Google and Yahoo require both SPF and DKIM from bulk senders, plus DMARC at least p=none (checked November 2026). See which one you need.
What is the difference between SPF and DKIM?
SPF checks whether the sending server's IP is allowed by the domain in the return path. DKIM checks a cryptographic signature on the message itself. SPF often breaks when mail is forwarded; DKIM usually survives if the message isn't changed. Details are in what is DKIM and the comparison table.
Why do SPF and DKIM pass but DMARC fails?
Because of alignment. DMARC passes when SPF or DKIM passes with a domain aligned to your From domain. If your sending service uses its own return-path and signing domain (as Postmark's default return path and Amazon SES's default MAIL FROM do), both can pass for the service's domain while none matches yours. Set up your own domain at the service. See fixing failures.
Which comes first: SPF, DKIM or DMARC?
SPF and DKIM first, DMARC after. DMARC builds on the results of the other two, so publish the records your sending service gives you, check that they align with your From domain, then publish DMARC at p=none and read the reports. The setup order has the four steps.
Does my email service set these up for me?
Partly. Every service in our table gives you SPF or DKIM records to publish, and several suggest a DMARC record, but only you can publish DMARC at your domain. How much each service covers differs; see the per-service table, checked November 2026 from vendor docs.
Which email API rotates DKIM keys automatically?
By their docs (checked November 2026), Mailgun rotates every 120 days by default, Mailtrap's site says it rotates monthly, Brevo rotates automatically with its CNAME setup, and SendGrid rotates automatically with automated security on. Postmark lets you trigger rotation by API; Resend doesn't rotate. See DKIM rotation.
What is DMARC in email?
DMARC (Domain-based Message Authentication, Reporting and Conformance) is a DNS record in which a domain tells receivers what to do with mail where neither SPF nor DKIM passes with an aligned domain, and where to send reports. It is now defined in RFC 9989 (May 2026). See what is DMARC.