EdgePosture EdgePosture by Alo Technologies
Engineering Playbook · 8 min read

Complete SPF (<=10 Lookups), DKIM & DMARC p=reject Guide

Step-by-step DNS templates to satisfy Google & Yahoo 2024+ bulk sender mandates, prevent permerror failures, and lock down domain spoofing.

1. Publish a Single SPF Record Within the 10-Lookup Budget (RFC 7208)

Every domain must have at most ONE TXT record starting with v=spf1. Mechanisms that trigger DNS queries (include, a, mx, ptr, exists, redirect) count cumulatively across nested includes toward the hard RFC 7208 limit of 10 DNS lookups. Exceeding 10 lookups causes a PermError, causing receivers to fail SPF silently. Remove unused marketing ESPs and avoid deprecated ptr mechanisms.

DNS TXT Record (@ / apex) — Google Workspace + Brevo Example
; Host: @   Type: TXT   TTL: 300
"v=spf1 include:_spf.google.com include:spf.brevo.com -all"

; Microsoft 365 + SendGrid Example:
"v=spf1 include:spf.protection.outlook.com include:sendgrid.net ~all"

; Non-Sending / Parked Domain Hardened Lock (pairs with MX 0 .):
"v=spf1 -all"

2. Enable 2048-Bit DKIM Signing Across Every Sending Provider

DKIM cryptographically binds your domain to outbound message headers and survives mailing-list forwarding where SPF breaks. Always generate 2048-bit RSA keys (or Ed25519 where supported) for every transactional and marketing sender (Google Workspace, Microsoft 365, Brevo, Resend, Postmark, SendGrid, AWS SES) and verify each selector resolves before advancing DMARC.

DNS CNAME / TXT Verification Pattern (selector._domainkey)
; Example 2048-bit DKIM TXT record:
; Host: google._domainkey   Type: TXT   TTL: 3600
"v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA..."

; Provider-managed CNAME delegation (e.g., Microsoft 365):
; Host: selector1._domainkey   Type: CNAME
selector1-yourdomain-com._domainkey.yourdomain.onmicrosoft.com

3. Roll Out DMARC Safely: p=none -> p=quarantine -> p=reject

Deploy DMARC in three controlled phases to guarantee zero legitimate mail disruption. Start with p=none and an active rua= aggregate report mailbox for 14 days to inventory shadow senders (omit fo=1 unless you explicitly configure a forensic ruf= URI). Once SPF or DKIM alignment exceeds 99%, move to p=quarantine; pct=25, then pct=100, and finally p=reject with explicit subdomain policy sp=reject. Keep relaxed alignment (adkim=r; aspf=r) for active sending domains: use strict adkim=s; aspf=s ONLY after verifying custom Return-Path / DKIM domain alignment across SendGrid, Mailchimp, Brevo, HubSpot, Klaviyo, or Salesforce to avoid breaking transactional or marketing email.

DNS TXT Record (_dmarc.yourdomain.com) — 3-Stage Rollout
; Stage 1 (Monitor Only — 14 Days; omit fo=1 unless ruf= is configured):
; Host: _dmarc   Type: TXT   TTL: 300
"v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com"

; Stage 2 (Quarantine Ramp — 14 Days):
"v=DMARC1; p=quarantine; sp=quarantine; pct=25; adkim=r; aspf=r; rua=mailto:dmarc@yourdomain.com"

; Stage 3 (Full Anti-Spoofing Enforcement — Safe Relaxed Alignment for ESPs):
"v=DMARC1; p=reject; sp=reject; pct=100; adkim=r; aspf=r; rua=mailto:dmarc@yourdomain.com"
; Optional Strict Mode (ONLY after verifying exact apex Return-Path & DKIM across all ESPs):
; "v=DMARC1; p=reject; sp=reject; pct=100; adkim=s; aspf=s; rua=mailto:dmarc@yourdomain.com"

4. Add MTA-STS (Testing -> Enforce), TLS-RPT & Google/Yahoo Out-of-Band Checklist

For domains receiving inbound mail, publish _mta-sts and _smtp._tls (TLS-RPT) records so sending MTAs enforce authenticated TLS in transit. Always start your HTTPS policy file with mode: testing and max_age: 86400 (24 hours) while monitoring TLS-RPT reports for MX hostname or certificate mismatches—only switch to mode: enforce and max_age: 604800 once zero TLS errors are confirmed. Note that Google & Yahoo's 2024+ bulk sender rules also mandate keeping Gmail Postmaster spam complaints below 0.3% and including RFC 8058 one-click List-Unsubscribe-Post headers on marketing mail.

MTA-STS Policy (Start in mode: testing) & TLS-RPT Records
; Host: _mta-sts   Type: TXT
"v=STSv1; id=20260601T000000Z"

; Host: _smtp._tls   Type: TXT
"v=TLSRPTv1; rua=mailto:tlsrpt@yourdomain.com"

; HTTPS Policy File: https://mta-sts.yourdomain.com/.well-known/mta-sts.txt
; Step 1: Start in mode: testing (max_age: 86400) for 7-14 days, then promote to mode: enforce (max_age: 604800)
version: STSv1
mode: testing
mx: *.mail.protection.outlook.com
max_age: 86400

5. Publish BIMI (Brand Indicators for Message Identification)

Once DMARC is enforcing at p=quarantine (pct=100) or p=reject, you can publish a BIMI TXT record at default._bimi to display your verified brand logo in supported inboxes. Host an SVG Tiny Portable/Secure (SVG P/S) logo over HTTPS in l= and optionally include a Verified Mark Certificate (VMC) PEM URL in a= (required by Gmail and Apple Mail for inbox logo rendering).

DNS TXT Record (default._bimi.yourdomain.com)
; Host: default._bimi   Type: TXT   TTL: 3600
"v=BIMI1; l=https://yourdomain.com/brand/logo-bimi.svg; a=https://yourdomain.com/brand/vmc.pem"

Frequently Asked Questions

What happens if my SPF record exceeds 10 DNS lookups?

Receiving mail servers return an RFC 7208 PermError, which fails SPF authentication and can trigger spam folder placement or DMARC rejection if DKIM is also unaligned.

Do non-sending domains still need SPF and DMARC?

Yes. Attackers routinely spoof parked or web-only domains that lack email records. Publish MX 0 . (RFC 7505 Null MX), TXT 'v=spf1 -all', and _dmarc 'v=DMARC1; p=reject; sp=reject;' to block spoofing completely.

Is p=none enough for Google and Yahoo 2024+ bulk sender rules?

Google and Yahoo require a valid DMARC record (minimum p=none) plus SPF and DKIM alignment for bulk senders (>=5,000/day), but p=none offers zero protection against brand impersonation. Advancing to p=quarantine or p=reject is strongly recommended.