SPF, DKIM and DMARC Explained for Senders

Updated

Short answer: SPF and DKIM are email authentication for your sending domain. DMARC adds a policy and checks that the domain SPF or DKIM authenticated aligns with the domain in your From: address. Gmail and Yahoo require SPF or DKIM from every sender and all three from bulk senders, and Outlook.com requires all three from domains that send more than 5,000 emails a day.

What each one does

You publish all three as DNS records for your domain. Microsoft tells senders to "Publish SPF and DKIM records for the domain", and Google treats a missing DMARC record as a problem in its own right.

  • SPF authenticates the domain you send from. Google asks every sender to "Set up SPF or DKIM email authentication for your sending domains." Microsoft says SPF "Must Pass for the sending domain."
  • DKIM adds a signature to each message. Microsoft says it "Must Pass to validate email integrity and authenticity." The signature is carried in a DKIM-Signature header field, and its h= tag lists header fields the signature covers. Gmail and Yahoo both require a key of at least 1024 bits.
  • DMARC is a record with a policy. Google: "Your DMARC enforcement policy can be set to none." The policy is written as p=none or, stricter, p=reject. DMARC passes using SPF or DKIM, as long as the domain that passed aligns with your From: domain.

Alignment

Google defines it: "For direct email, the domain in the sender's From: header must be aligned with either the SPF domain or the DKIM domain. This is required to pass DMARC alignment."

SPF and DKIM can pass for a domain that isn't the one in your From: address. When neither of them aligns, DMARC fails even though both checks passed. Gmail's message for rate-limit code 4.7.32 describes this case: "Your email has been rate limited because the From: header (RFC5322) in this message isn’t aligned with either the authenticated SPF or DKIM organizational domain."

How strict each provider is:

  • Gmail: "only one of these needs to be aligned to meet the sender alignment requirements." But Google adds: "It’s likely that DMARC alignment with both SPF and DKIM will eventually be a sender requirement."
  • Yahoo: "Ensure the domain in the From: header is aligned with either the SPF domain or the DKIM domain." It adds that "Relaxed alignment is acceptable".
  • Outlook.com: DMARC must "align with either SPF or DKIM (preferably both)."

All three accept one aligned check today, and two of them point toward both. If you can align SPF and DKIM, do.

What Gmail, Yahoo and Outlook.com require

ProviderEvery senderBulk or high-volume senders
GmailSPF or DKIMSPF and DKIM, a DMARC record whose policy can be p=none, and a From: domain aligned with SPF or DKIM
YahooSPF or DKIM at a minimumSPF and DKIM, a DMARC policy of at least p=none that passes, and a From: domain aligned with SPF or DKIM
Outlook.comThe 2025 rules target domains sending more than 5,000 emails a daySPF and DKIM must both pass, and DMARC must be at least p=none and aligned with SPF or DKIM, with p=reject recommended

On key length, Google says "Sending to personal Gmail accounts requires a DKIM key of 1024 bits or longer", and Yahoo says "We require a DKIM key length of 1024 bits or greater".

Who counts as a bulk sender differs. Google's line is around 5,000 messages a day to personal Gmail accounts, though its pages word it several ways. Yahoo "will not specify a volume threshold". Microsoft's announcement says more than 5,000 emails a day. The details are in Gmail and Yahoo Bulk Sender Requirements and Outlook.com Rules for High-Volume Email Senders.

What failure looks like

WhereWhat you may see
GmailUnauthenticated mail "might be marked as spam or rejected with a 5.7.26 error."
Gmail4.7.31: rate limited because the sending domain has no DMARC record, or the record sets no policy
Gmail4.7.32: rate limited because the From: header isn't aligned with the SPF or DKIM domain
YahooMail "may be sent to the spam folder or rejected."
Outlook.comMail sent to Junk, or rejected with 550 5.7.515

Microsoft's support article explains that last error: "your message was rejected because the domain in your 5322.From email address (also known as the From address or P2 sender) didn't pass the required email authentication level for senders of large volumes of email to Microsoft consumer email services."

Set them up, step by step

  1. List every service that sends mail with your domain in the From: address, such as your email platform, CRM and help desk. Each one has to pass the checks below.
  2. Publish SPF for your sending domain, and check that it passes.
  3. Turn on DKIM signing with a key of 1024 bits or longer, publish the DKIM record, and check that it passes.
  4. Publish a DMARC record with a policy of at least p=none.
  5. Check alignment: the From: domain must align with the SPF domain or the DKIM domain. Align both if you can.
  6. Look up your records, then watch your sending logs for the codes in the table above.
  7. Once everything passes, consider a stricter policy. Microsoft's Postmaster page recommends p=reject.

DKIM also matters for unsubscribing: RFC 8058 says one-click unsubscribe headers "MUST be covered by the signature". One-Click Unsubscribe (RFC 8058) Explained covers the rest.

Common mistakes

  • A DMARC record without a policy. Gmail's 4.7.31 covers a record that "doesn’t specify a DMARC policy."
  • SPF or DKIM passing for the wrong domain. If neither aligns with your From: domain, DMARC fails on alignment.
  • A DKIM key shorter than 1024 bits. Gmail and Yahoo both require at least 1024.
  • Only one of SPF and DKIM. Bulk senders need both at Gmail and Yahoo, and both must pass at Outlook.com.

Precheckly's free SPF, DKIM and DMARC checker looks up your domain's SPF, DKIM (with an optional selector), DMARC and MX records, and suggests a fix for each problem it finds. It checks DNS only, not message headers.

Sources

Not legal advice. Carrier rules and provider documentation change, so check the linked sources before you rely on them.