Skip to content
lubemy

SPF, DKIM and DMARC Explained: A Plain-English Guide

SPF lists the servers allowed to send mail for your domain, DKIM signs each message, and DMARC checks that at least one of them passes for the domain shown in the From address, then tells receivers what to do when it doesn't. Gmail and Yahoo have required all three from bulk senders since 2024, and Outlook.com since May 2025; for everyone else they are the baseline for inbox placement and for making your domain harder to spoof. Setup takes a few hours, but DMARC should reach p=reject in stages, guided by its reports.

lubemy technical team · Published on 14 October 2026

SPF, DKIM and DMARC at a glance

All three are DNS TXT records on your domain. Nothing gets installed on laptops or mail clients: the receiving server looks them up to decide how far to trust a message.

RecordQuestion it answersWhere it lives
SPFIs this server allowed to send for the envelope sender (Return-Path) domain?TXT on example.com
DKIMWas this message signed by the domain, and is it unchanged?TXT at selector._domainkey.example.com
DMARCDoes SPF or DKIM pass for the domain the recipient sees in From? If not, what should happen?TXT at _dmarc.example.com

Think of SPF as the guest list at the door, DKIM as a tamper-evident seal, and DMARC as your standing instruction to the receiving mail room, plus a regular report on what turned up.

SPF: which servers may send for you

A typical small-business record on Microsoft 365, with a web server sending contact-form mail and an online store using a transactional email service:

example.com.  TXT  "v=spf1 include:spf.protection.outlook.com ip4:203.0.113.10 include:spf.transactional.example -all"
  • v=spf1 must come first.
  • include: hands off to another domain's list. Microsoft 365 needs include:spf.protection.outlook.com, Google Workspace include:_spf.google.com, and most sending platforms give you their own.
  • ip4: and ip6: authorise specific addresses, such as your web server.
  • The final term covers everyone else: -all means “not authorised”, ~all “probably not authorised”. ?all and +all protect nothing.

Two limits matter: SPF checks the envelope sender, not the From address people see, and it breaks on auto-forwarding, because the forwarding server isn't on your list.

~all or -all? The big providers disagree

Google recommends ~all for Google Workspace; Microsoft recommends -all for Microsoft 365. With DKIM and DMARC in place the difference matters less, since the DMARC policy drives the outcome. Follow your mail provider's documentation and never leave ?all or +all in production.

DKIM: a signature on every message

The sending server signs each message with a private key. The receiver reads the signing domain (d=) and selector (s=), fetches the public key from DNS and checks nothing was altered in transit:

s1._domainkey.example.com.  TXT  "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..."
  • The sending service (mailbox provider, newsletter tool, helpdesk) generates the key; you publish the record. Each service has its own selector, so several keys can coexist on one domain.
  • Gmail requires keys of at least 1024 bits and recommends 2048. A 2048-bit key exceeds the 255-character limit of a single TXT string; if your DNS panel rejects it, split it into several quoted strings in one record, which receivers join back together.
  • DKIM usually survives forwarding, but breaks when content is rewritten, for example by a mailing list that adds a footer.

DMARC and alignment: the part most setups miss

A scammer can send from their own server, pass SPF for their own domain and still put yours in From. DMARC closes that gap: a message passes only if SPF or DKIM passes and is aligned with the From domain. Under relaxed alignment, the default, the same organisational domain is enough, so mail.example.com aligns with example.com.

This is where setups fail quietly. A marketing platform using its own bounce domain passes SPF for its domain, not yours, so DMARC still fails. Enable DKIM signing with your domain on that platform, or a custom Return-Path on your subdomain. Your first DMARC record should only monitor:

_dmarc.example.com.  TXT  "v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com"
  • p= is the policy: none (monitor only), quarantine (usually the spam folder) or reject.
  • rua= is where aggregate reports go: periodic XML files, typically daily, showing who sent as your domain, from which IPs, with what result. No rua, no reports. Use a dedicated mailbox or a report-processing service.
  • sp= sets a subdomain policy; adkim= and aspf= pick relaxed (r, default) or strict (s) alignment.

pct or t=y? The standard just changed

Many guides, Google's included, suggest pct to apply a policy to a percentage of failing mail. In May 2026, RFC 9989 obsoleted RFC 7489 and dropped pct, because only 0 and 100 behaved consistently in practice; it introduces t=y, asking receivers to apply the policy one step softer. Until receivers catch up, don't rely on in-between percentages: step p= up instead.

Common mistakes that break authentication

  1. Two SPF records on one domain, usually because whoever set up the newsletter added a record instead of editing the existing one. Under RFC 7208 that returns permerror, a permanent failure. Merge everything into one record.
  2. More than 10 DNS lookups. include, a, mx, ptr, exists and redirect each count, and nested includes add theirs; ip4, ip6 and all don't. Past 10, SPF returns permerror. Fixes: drop retired services, move bulk mail to a subdomain, and swap an include for ip4/ip6 ranges only when the vendor's IPs are stable and documented.
  3. The ptr mechanism, which RFC 7208 says should not be published, and syntax slips such as a trailing dot or include= instead of include:.
  4. Forgotten senders: invoicing app, online store, CRM, helpdesk. Each must be in SPF or, better, sign with DKIM as your domain.
  5. Contact forms that send as the visitor. If a WordPress form puts the visitor's Gmail address in From, the message fails DMARC, and Google explicitly asks senders not to impersonate Gmail From headers. Send from your own domain and put the visitor in Reply-To.
  6. Jumping straight to p=reject and losing legitimate mail nobody had inventoried.
  7. Parked domains with no records. Microsoft recommends v=spf1 -all; add DMARC at p=reject and they become far less useful for spoofing.

A staged DMARC rollout: p=none to p=reject

RFC 9989 advises publishing p=none for at least a month, then p=quarantine for as long again before p=reject, comparing reports along the way. Treat that as a floor: many third-party senders or seasonal campaigns call for more time.

  1. Prepare: one SPF record under 10 lookups and DKIM on every sending service. Google suggests waiting 48 hours after SPF and DKIM before publishing DMARC.
  2. Monitor at p=none for at least four weeks and list your legitimate sources. Every unknown IP is a forgotten service or someone using your domain.
  3. Fix DKIM or alignment for each legitimate source that fails.
  4. Move to p=quarantine and keep reading reports and feedback from colleagues and customers.
  5. Move to p=reject: receivers that enforce DMARC refuse unauthenticated mail using your domain in From.
  6. Maintain: configure each new sending service before it goes live, not after the first bounces.

Forwarding and mailing lists

Even with everything correct, p=reject can cost some legitimate mail: forwarding breaks SPF, and lists that modify messages break DKIM. That's why RFC 9989 says domains whose users post to internet mailing lists should not publish p=reject, or should do so only after the staged rollout and after warning those users. If reports show this traffic, take the last step carefully.

Gmail, Yahoo and Outlook.com sender requirements

Gmail's rules apply to mail sent to personal accounts (@gmail.com and @googlemail.com), not to Google Workspace mailboxes. Here's the picture from the official pages, checked in October 2026:

GmailYahoo MailOutlook.com, Hotmail, Live
In force since1 February 2024; stricter enforcement from November 2025, including temporary and permanent rejectionsFebruary 2024, phased enforcement5 May 2025; non-compliant mail is rejected with error 550 5.7.515
Bulk senderMore than 5,000 messages a day to personal Gmail accountsNo published numeric thresholdDomains sending more than 5,000 messages a day
All sendersSPF or DKIM, valid forward and reverse DNS (PTR), TLS, spam rate below 0.3%SPF or DKIM, valid forward and reverse DNS, spam rate below 0.3%No specific published rules
Bulk sendersSPF and DKIM, DMARC of at least p=none, alignment, one-click unsubscribeSPF and DKIM, DMARC of at least p=none, alignment (relaxed is fine), one-click unsubscribe honoured within 2 daysSPF and DKIM passing, DMARC of at least p=none aligned with SPF or DKIM

Two details matter for agencies. Gmail counts your primary domain and its subdomains together, and once you cross the threshold you stay a bulk sender with no expiry. And it's about volume, not company size: one campaign to more than 5,000 Gmail addresses is enough. Google's target spam rate is below 0.1%.

Worth doing below the threshold too

Publishing all three records now costs little and spares you a scramble the day your mailing list outgrows the threshold.

How to check your setup

# SPF: exactly one line starting with v=spf1
dig +short TXT example.com

# DMARC
dig +short TXT _dmarc.example.com

# DKIM: the selector is in your provider's settings or the signature (s=)
dig +short TXT s1._domainkey.example.com

# Windows
nslookup -type=TXT _dmarc.example.com
  • Send a test to a Gmail mailbox and choose More > Show original: the Authentication-Results header should show spf=pass, dkim=pass and dmarc=pass.
  • Repeat from every service that sends as your domain: website, newsletter tool, invoicing app, online store.
  • Check the passing DKIM signature is for your domain (header.i=@example.com), not only the platform's.
  • Verify your domain in Google Postmaster Tools to track spam rate, authentication and delivery errors at Gmail.
  • Review DMARC reports weekly while monitoring, then at least monthly.
  • Keep a shared list of every service sending for the domain and its DKIM selector.

If you manage mail for a portfolio of client domains and would like us to review the DNS records while you set up each service, the lubemy support team can work through it with you.

Official sources

Want us to handle it?

Tell us about your case: we reply with a concrete plan, clear scopes and a written price.