Email Security Guide

This guide is for IT consultants helping clients secure email on new or existing domains. It covers DNS authentication (SPF, DKIM, DMARC) and how it applies across common platforms—Google Workspace, Microsoft 365, Proton, and custom hosting. See the Enterprise Playbook v3.0 for the full consultant lifecycle (Cloudflare, BIMI, DMARC graduation, SB 2610). See Platform guides for provider-specific checklists.

This guide explains how to protect a domain’s email channel using DNS-based authentication and related controls. It is organized around two common situations:

  1. New domain — You are bringing a domain online and want correct authentication from day one.
  2. Existing domain — Mail is already flowing; you need to discover what is sending, fix gaps, and tighten policy without breaking legitimate traffic.

Use the dedicated checklists for day-to-day execution:


How the pieces fit together

Control What it does DNS location (typical)
SPF Lists hosts allowed to send mail for the domain TXT at @ (root)
DKIM Cryptographic signature on each message; public key in DNS TXT at selector._domainkey
DMARC Policy when SPF/DKIM fail; aggregate/forensic reports TXT at _dmarc
CAA (recommended) Restricts which CAs may issue TLS certs for the domain CAA at root
DNSSEC (recommended) Signs DNS responses to reduce spoofing of your zone Provider-specific

SPF and DKIM prove authenticity. DMARC tells receivers what to do when checks fail and gives you visibility through reports.

flowchart LR
  subgraph send [Your infrastructure]
    M[Mail servers / SaaS]
  end
  subgraph dns [DNS]
    SPF[SPF TXT]
    DKIM[DKIM TXT]
    DMARC[DMARC TXT]
  end
  subgraph recv [Receiving provider]
    V[SPF + DKIM verify]
    P[Apply DMARC policy]
  end
  M --> V
  SPF --> V
  DKIM --> V
  V --> P
  DMARC --> P

Phase 0: Inventory (both new and existing)

Before changing DNS, document every system that sends mail as your domain (not only “from” your primary mailbox):

Category Examples
Productivity Google Workspace, Microsoft 365
Marketing Mailchimp, HubSpot, Constant Contact
Transactional SendGrid, Postmark, Amazon SES, Mailgun
CRM / sales Salesforce, outreach tools
Internal Ticketing, monitoring, scripts on fixed IPs

For each sender, record:

New domain: Complete this inventory before go-live so the first SPF/DKIM/DMARC records are complete.

Existing domain: Treat this as discovery—compare inventory to DMARC aggregate reports (rua) to find unknown senders.


SPF (Sender Policy Framework)

Syntax essentials

Example (illustrative):

v=spf1 include:_spf.google.com include:sendgrid.net ip4:203.0.113.10 -all

Limits and pitfalls

Verification

dig TXT example.com +short

Look for v=spf1 and confirm -all or ~all at the end.


DKIM (DomainKeys Identified Mail)

Setup flow

  1. Enable DKIM in each sending platform (admin console).
  2. Publish the provider’s public key as a TXT record: SELECTOR._domainkey.example.com.
  3. Keep the private key only on the mail platform; rotate per vendor guidance (often every 6–12 months).

Typical record shape:

v=DKIM1; k=rsa; p=<base64-public-key>

Use 2048-bit keys when the provider supports them.

Pitfalls

Verification

dig TXT google._domainkey.example.com +short

Send test mail; headers should show dkim=pass in Authentication-Results.


DMARC (Domain-based Message Authentication, Reporting & Conformance)

Record location

Host/name: _dmarc (full name: _dmarc.example.com)

Recommended progression

Stage Policy Purpose
1 – Monitor p=none Collect reports; fix alignment and missing senders
2 – Soft enforce p=quarantine Failed mail to spam/junk
3 – Enforce p=reject Block spoofed mail that fails auth

Starter record (monitoring):

v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com; adkim=r; aspf=r;

Tighten when legitimate mail consistently passes:

v=DMARC1; p=quarantine; sp=quarantine; np=reject; rua=mailto:dmarc-reports@example.com

Goal state:

v=DMARC1; p=reject; sp=reject; np=reject; rua=mailto:dmarc-reports@example.com

Roll out by changing p (none → quarantine → reject). Do not use fractional pct — DMARCbis (RFC 9989) obsolete that tag; most receivers ignored it anyway. For temporary monitor-while-enforced testing, use t=y instead of pct=0.

Tags to know

Tag Meaning
p Policy for organizational domain
sp Policy for subdomains (if different)
np Policy for non-existent subdomains (DMARCbis; prefer reject)
rua Aggregate report mailbox(es)
ruf Forensic reports (optional; privacy-sensitive)
t Testing mode (t=y = treat policy as monitor-only; default off)
pct Legacy — omit on new records; safe to remove if present
adkim / aspf Strict (s) vs relaxed (r) alignment

Alignment

DMARC passes only when the domain in the visible From: header aligns with the domain validated by SPF or DKIM. Third-party tools that send From: vendor.com while using your envelope domain often need configuration changes (custom return-path, aligned DKIM) or separate subdomains.

Reports


Additional DNS hardening

CAA (Certificate Authority Authorization)

Restrict TLS certificate issuance to CAs you actually use:

example.com.  CAA 0 issue "letsencrypt.org"
example.com.  CAA 0 issuewild "letsencrypt.org"
example.com.  CAA 0 iodef "mailto:security@example.com"

DNSSEC

Enable at your DNS provider when supported. Misconfiguration can break resolution for validating resolvers—follow provider docs and verify with dig +dnssec example.com.

Subdomain and dangling records


New domain vs existing domain

New domain (greenfield)

  1. Complete sender inventory before DNS cutover.
  2. Publish MX, SPF, DKIM, and DMARC (p=none) together.
  3. Verify with test messages before marketing or bulk sends.
  4. Schedule DMARC enforcement only after 2–4 weeks of clean reports (adjust for volume).

Existing domain (brownfield)

  1. Do not jump to p=reject without reports.
  2. Audit current TXT/CAA/MX; fix +all, duplicate SPF, and missing DKIM.
  3. Add or fix rua; run p=none until all legitimate sources pass.
  4. Communicate with owners of CRM/marketing tools before quarantine/reject.
  5. Re-test after any provider change, IP change, or new subdomain.

Troubleshooting

Symptom Likely cause Action
SPF fail for all mail No record, multiple SPF records, or >10 lookups Single consolidated SPF; flatten or replace include: with IPs
SPF fail for one service Missing include: or IP Add sender to SPF; wait for DNS TTL
DKIM fail Wrong selector, typo in p=, key rotation not updated Match selector; republish key from provider
DMARC fail, SPF/DKIM pass Alignment (From domain ≠ signing domain) Configure provider for aligned DKIM or dedicated subdomain
Legitimate mail blocked after enforce Moved to p=reject too soon Revert to p=quarantine or p=none (or set t=y briefly); fix source; re-enforce via none → quarantine → reject
Changes “not working” DNS propagation / cache Lower TTL before changes; wait up to 48h; flush local DNS cache

Useful tools


Maintenance cadence

Interval Task
Quarterly Review sender inventory vs DMARC reports; remove decommissioned include: entries
On change Re-verify SPF/DKIM/DMARC when adding mail vendors, IPs, or subdomains
Annually DKIM key rotation per policy; CAA and DNSSEC review

References