Publishing an SPF record (v=spf1) has been standard advice for years, and for good reason. On its own, however, SPF is not sufficient to stop someone outside your company from spoofing an executive's address in a customer's inbox.

Why is that? SPF only checks the hidden bounce address on the SMTP envelope (RFC5321.MailFrom, or Return-Path), not the visible From: ceo@example.com header (RFC5322.From) that Outlook, Gmail, and Apple Mail actually show on screen. Someone running an external mail server can send from bounce@mailer-example.net, pass SPF cleanly for that envelope domain, and still display From: "Accounts Receivable" <ar@example.com> to your customers.

This is where DMARC (Domain-based Message Authentication, Reporting, and Conformance, RFC 7489) comes in—specifically, a rule called identifier alignment. Under DMARC, an email passes only when SPF passes and that envelope domain matches the visible From: domain, or when the message carries a valid DKIM signature whose d= signing domain matches From:. Getting to enforcement takes a bit of care, though. Jump straight to p=reject on day one and you will likely drop legitimate ERP invoices, CRM quotes, or office scanner emails. Leave the record parked on p=none indefinitely, and all you get are XML reports while domain spoofing stays wide open. If you want to build syntax-checked _dmarc strings, external _report._dmarc records, and lookup commands while working through this, open our DMARC Record & Rollout Builder alongside this guide.

How SPF, DKIM, and DMARC Alignment Fit Together

When a DMARC rollout breaks legitimate mail, third-party SaaS senders are usually the reason. Maybe your marketing platform or billing portal already sits inside your root SPF include: list, so you assume it is covered? Often it isn't. Even with that include: in place, SPF alignment still fails whenever the vendor puts its own bounce subdomain in Return-Path (such as em4829.sendgrid.net or bounces.hubspot.com), unless you either delegate a custom bounce CNAME on your domain or sign outbound mail with aligned DKIM.

Protocol Identity Validated Alignment Rule (aspf / adkim) Survives Forwarding?
SPF (RFC 7208) Connecting MTA IP vs. SMTP envelope RFC5321.MailFrom (Return-Path) aspf=r (relaxed, default): organizational domain matches From:
aspf=s (strict): exact FQDN matches From:
No, unless the forwarder rewrites the envelope via SRS; forwarded IPs fail raw SPF checks
DKIM (RFC 6376) 2048-bit RSA or Ed25519 signature header (DKIM-Signature: d=example.com; s=selector1;) adkim=r (relaxed, default): d= shares organizational domain with From:
adkim=s (strict): exact domain match
Yes, provided intermediary gateways do not alter signed headers or MIME body bytes
DMARC (RFC 7489) Requires aligned SPF pass or aligned DKIM pass against visible RFC5322.From Instructs receivers to apply none, quarantine, or reject and emit aggregate RUA XML reports Yes, whenever aligned DKIM remains intact across the forwarding hop

Checking What Already Lives in DNS

Query your authoritative nameservers before editing anything in the zone file. Any hostname may publish at most one v=spf1 TXT record, and _dmarc.<domain> may hold at most one v=DMARC1 TXT record. Adding a second SPF TXT string instead of editing the existing one is an easy mistake, and receiving servers respond to it by aborting evaluation with SPF PermError.

# 1. Inspect current SPF TXT record at the apex domain
dig +short TXT example.com | grep -i "v=spf1"

# 2. Check whether a _dmarc record already exists
dig +short TXT _dmarc.example.com

# 3. Verify Microsoft 365 DKIM CNAME delegation and 2048-bit public key resolution
dig +short CNAME selector1._domainkey.example.com
dig +short TXT selector1-example-com._domainkey.example.onmicrosoft.com

Staying Under the 10-Lookup SPF Limit With Subdomains

RFC 7208 Section 4.6.4 puts a hard ceiling of 10 DNS-querying mechanisms (include, a, mx, ptr, exists, and redirect) across the entire nested SPF lookup tree, while raw ip4 and ip6 literals cost zero lookups. That budget runs out fast. Stack Microsoft 365, a CRM, a marketing tool, a helpdesk, and an ERP mailer on the apex domain, and the nested vendor includes routinely blow past 10 and trigger permerror.

Some teams try to work around that limit with IP-flattening scripts that inline dozens of vendor CIDR blocks straight into the root TXT record. That creates its own headaches: cloud mailers rotate IP ranges without warning, and sprawling TXT strings can bump into UDP packet limits. A cleaner fix is splitting mail streams across subdomains.

Keep the root domain (@example.com) reserved for actual human mailboxes, limiting its SPF record to your primary mail suite (for example, "v=spf1 include:spf.protection.outlook.com ~all") alongside 2048-bit DKIM signing in Exchange Online or Google Workspace. Automated invoices (ar@billing.example.com), marketing campaigns (news@mail.example.com), and system alerts (noreply@notify.example.com) can each live on their own functional subdomain, giving every stream a fresh 10-lookup SPF budget, separate DKIM selectors, and isolated sender reputation. While mapping those streams, ask around finance, HR, and operations for the quiet senders people forget about: accounting portals, DocuSign custom-domain envelopes, payroll notifications, multifunction office copiers, and website contact-form relays.

Starting at p=none and Reading RUA Reports

Start in observation mode (p=none) and let it run for two to four weeks. Make sure that window crosses a month-end billing and payroll cycle so once-a-month legitimate senders show up in your daily aggregate XML reports (rua) before you tighten anything:

; Stage 1 monitoring record (_dmarc.example.com TXT, TTL 3600)
_dmarc.example.com. 3600 IN TXT "v=DMARC1; p=none; sp=none; rua=mailto:dmarc-rua@example.com; adkim=r; aspf=r; fo=1;"

If your rua= address points to a mailbox on another organizational domain (say, sending reports for subsidiary.org to dmarc-rua@parentcompany.com), RFC 7489 Section 7.1 requires an authorization TXT record on the destination domain; without it, receiving mail servers quietly drop those external reports:

subsidiary.org._report._dmarc.parentcompany.com. 3600 IN TXT "v=DMARC1;"

One practical note on report types: Gmail, Microsoft, Yahoo, and most other large providers rarely send per-message forensic failure samples (ruf=) anymore because raw headers and message bodies carry privacy exposure. Plan on working from daily rua= XML summaries instead. When reading an uncompressed RUA file, compare <policy_evaluated> against <identifiers> and <auth_results>:

<record>
  <row>
    <source_ip>198.51.100.42</source_ip>
    <count>318</count>
    <policy_evaluated>
      <disposition>none</disposition>
      <dkim>fail</dkim>
      <spf>fail</spf>
    </policy_evaluated>
  </row>
  <identifiers>
    <header_from>example.com</header_from>
    <envelope_from>bounces.vendor-mailer.example</envelope_from>
  </identifiers>
  <auth_results>
    <dkim>
      <domain>vendor-mailer.example</domain>
      <result>pass</result>
    </dkim>
    <spf>
      <domain>bounces.vendor-mailer.example</domain>
      <result>pass</result>
    </spf>
  </auth_results>
</record>

Look at what happened in that sample record. Both raw SPF and raw DKIM passed for vendor-mailer.example, yet DMARC still failed because neither domain matched header_from (example.com). Publishing that vendor's custom DKIM CNAMEs on example.com, or moving those messages onto a delegated subdomain with aligned DKIM, fixes the stream without adding another lookup to your root SPF record.

Moving Through Quarantine to p=reject

Doesn't the pct= tag let you test p=reject on a small slice of mail while leaving the rest untouched? Not quite the way most operators assume. Under RFC 7489 Section 6.6.4, setting p=reject; pct=25; tells receivers to reject 25% of failing messages and apply quarantine—not none—to the other 75%. Mailbox providers also sample locally and inconsistently, which is why the IETF DMARCbis revision deprecates pct= altogether. Clean up every real sender's alignment while you are still on p=none rather than counting on pct= to cushion unaligned business mail.

Watch subdomain inheritance as well. Under RFC 7489, subdomains inherit the root domain's p= policy automatically unless an explicit sp= tag on the apex record or a dedicated subdomain _dmarc record says otherwise. Once your active subdomains are accounted for, setting sp=reject blocks attackers from inventing fake subdomains like @payroll-update.example.com.

Rollout Stage Example _dmarc TXT Value Operational Exit Gate
Discovery v=DMARC1; p=none; sp=none; rua=mailto:dmarc-rua@example.com; fo=1; 2 to 4 weeks covering month-end billing; 100% of authorized senders pass aligned DKIM or aligned SPF
Quarantine check v=DMARC1; p=quarantine; rua=mailto:dmarc-rua@example.com; Unaligned mail routes to recipient Spam/Junk folders; watch helpdesk tickets and daily RUA disposition counts for 2 weeks
Full enforcement v=DMARC1; p=reject; sp=reject; rua=mailto:dmarc-rua@example.com; adkim=r; aspf=r; Receiving MTAs reject unaligned spoofed mail during SMTP (550 5.7.1) across both apex and unconfigured subdomains

Once you reach enforcement, keeping ~all (SoftFail) rather than -all (HardFail) on human mailbox domains stops overly aggressive forwarders from dropping forwarded messages at SMTP time before checking surviving DKIM signatures. Dedicated non-human subdomains and parked domains do not have that problem and can safely publish -all. In fact, any parked or defensive lookalike domain you own should be locked down right away with three records: "v=spf1 -all" at the apex, a revoked wildcard DKIM key (*._domainkey IN TXT "v=DKIM1; p=;"), and "v=DMARC1; p=reject; sp=reject;" at _dmarc.

Of course, DMARC only stops external senders from faking your domain; it will not stop someone who steals a real employee's session cookie and sends mail from inside Microsoft 365. Pairing domain enforcement with phishing-resistant MFA in Microsoft Entra ID and our email authentication and BEC protection work closes both halves of that problem.