Email Auth Fails After Migration: A Troubleshooting Guide for SPF/DKIM/DMARC Issues
A practical playbook for admins fixing SPF, DKIM and DMARC post-migration—diagnostics, scripts, and a staged recovery plan to restore deliverability fast.
Hook: Your email stopped delivering after migration — here’s the playbook to fix SPF, DKIM and DMARC fast
You migrated off Gmail or changed domains and suddenly your transactional alerts, marketing campaigns, or internal notifications bounce or land in spam. That’s not a coincidence — email authentication is fragile during migrations. This guide is a targeted troubleshooting playbook for sysadmins and dev teams in 2026 who need fast, deterministic fixes: diagnostics, remediation scripts, and a staged recovery plan that gets mail flowing and preserves deliverability.
The reality in 2026: why deliverability is stricter and faster to break
In late 2025 and into 2026 major mailbox providers accelerated enforcement of DMARC alignment and tightened DKIM checks, while AI-driven spam filters give less tolerance for configuration drift. Google’s January 2026 policy and UI changes (including easier primary address changes for Gmail users) increased churn in mailbox identity — a small factor that magnifies the impact of any missing DNS record after migration. The net result: small DNS mistakes now cause immediate, measurable deliverability failures.
Key trends to keep top-of-mind
- Wider enforcement of DMARC p=quarantine/reject by major providers.
- Higher adoption of MTA-STS and TLS-RPT causing transient failures for misconfigured TLS endpoints.
- Greater sensitivity to SPF length and include chain limits (DNS lookup cap still at 10).
- Increased use of ARC to preserve authentication for forwarded mail. See also work on automation and gateway workflows that help manage complex forwarding fleets.
Quick diagnosis checklist — determine scope in 10 minutes
Before changing any DNS, run these checks to scope the problem: which authentication fails (SPF, DKIM, DMARC), where failures occur (inbound to providers or outbound to recipients), and whether it’s systemic or sender-specific.
- Check bounce messages and headers — look for spf=fail, dkim=fail, or dmarc=fail.
- Verify DNS for SPF, DKIM selector, DMARC via dig/nslookup.
- Confirm MX records point to intended mail service (not old provider or placeholder).
- Inspect message headers using a failing sample — trace Received and Authentication-Results.
- Collect aggregate DMARC reports (rua) and TLS-RPT reports to see provider-side telemetry.
Fast CLI diagnostics (copy/paste)
Run these commands from any Unix shell. Replace domain, selector, and hostnames.
# SPF: fetch TXT and simulate SPF by checking includes and ip ranges
dig +short TXT example.com
# DKIM: fetch public key for selector 's1'
dig +short TXT s1._domainkey.example.com
# DMARC:
dig +short TXT _dmarc.example.com
# MX records:
dig +short MX example.com
# Test DKIM signing verification (simulate verifying a signed body with OpenSSL public key)
# Fetch public key then run the verification steps in your preferred DKIM tool.
Deep diagnostics — what each failure means and where to look
1) SPF failures
Symptom: header shows spf=fail and bounce codes often reference SPF or 550 5.7.1. Common causes after migration:
- SPF record still points to old provider (e.g., include:_spf.google.com).
- New outbound IPs are not included; you exceeded DNS lookup limits (10).
- Sender uses a different envelope-from domain (forwarding or relay) and SPF alignment fails.
SPF diagnostic script
# spf-check.sh - quick SPF textual checker (bash)
DOMAIN=example.com
echo "SPF for $DOMAIN:"; dig +short TXT $DOMAIN | grep -i "v=spf1"
# Expand includes roughly — note this is a heuristics check, not a full SPF evaluator
for INC in $(dig +short TXT $DOMAIN | tr -d '"' | tr ' ' '\n' | grep include | cut -d: -f2); do
echo "Includes: $INC ->"; dig +short TXT $INC
done
Remediation steps
- Update the SPF TXT to include the new provider IP ranges or include mechanism (e.g., include:spf.protonmail.ch, include:spf.sendgrid.net).
- Collapse mechanisms to stay under 10 DNS lookups — use IP literals where sensible or a dedicated SPF flattening service.
- If mail is forwarded, implement SRS (Sender Rewriting Scheme) on your relay or use ARC to preserve authentication.
- Set a low TTL during migration (e.g., 300s) to iterate quickly, then raise TTL after stabilization.
2) DKIM failures
Symptom: header shows dkim=fail or no DKIM signature at all. After migration, common failure modes:
- Missing or incorrect DKIM DNS record for your selector.
- Key length too short or corrupted in DNS (providers now commonly require 1024+; 2048 is recommended).
- Message body modified in transit (line endings, HTML rewriting, plus mailing lists altering content).
- Signing domain does not align with From domain (DMARC alignment fails).
DKIM diagnostic commands
# Get DKIM public key for selector s1 on example.com
dig +short TXT s1._domainkey.example.com
# Simple openssl check: ensure DKIM public key is parseable
# (paste the p= value into a file pubkey.pem after decoding to PEM format)
Remediation steps
- Confirm the selector published in DNS matches the selector used by your MTA. If migrating providers, either reuse the selector or update the MTA config.
- Roll a new 2048-bit key if the current key is weak. Example generation (on your MTA host):
# Generate DKIM key pair (example)
openssl genrsa -out private.key 2048
openssl rsa -in private.key -pubout -out public.key
# Convert public key into DNS-friendly TXT (remove headers/footers, whitespace)
Publish the public key at selector._domainkey.example.com as a TXT record and monitor for acceptance. If your mail passes through a rewriting gateway, consider signing at the gateway or use the gateway’s signing key but ensure domain alignment.
3) DMARC failures
Symptom: header shows dmarc=fail and recipient providers apply quarantine or reject. DMARC requires both SPF or DKIM alignment with the From domain.
DMARC diagnostics
# Check DMARC record
dig +short TXT _dmarc.example.com
# Example output: "v=DMARC1; p=quarantine; rua=mailto:dmarc-agg@collector.example.net; ruf=mailto:forensic@...; pct=100"
Remediation plan
- Start with a permissive policy: p=none and collect rua reports. Analyse reports for 48–72 hours to discover failing senders.
- Fix SPF/DKIM alignment for all legitimate senders (use subdomain delegation or explicit DKIM signing aligned with From domain).
- Move to stricter policies gradually: p=none → p=quarantine (10–20% via pct) → p=reject.
- Set rua to a reliable aggregate collector (commercial or self-hosted parser) and monitor forensic ruf only if you can handle sensitive data safely.
Post-migration recovery playbook — actionable steps, in order
Follow this sequence to restore deliverability after migrating off Gmail or changing domains.
- Lock inbound routing: Ensure MX records point to your intended provider. If you planned for phased migration, use weighted MX or temporary routing to avoid split-brain.
- Publish and verify SPF: Make a canonical SPF record that includes all sending services; test with simulated sends to major providers (Gmail, Microsoft, Yahoo).
- Publish DKIM: Ensure selectors are present and published. Sign at the point of egress for full alignment.
- Publish DMARC with p=none and rua configured. Collect and analyze reports for 72 hours.
- Enable MTA-STS and TLS-RPT: publish mta-sts.example.com policy and a TLS-RPT address to capture TLS failures from providers enforcing strict transport security.
- Run test sends to seed accounts at target providers and inspect Authentication-Results headers. Use seed lists for Gmail Postmaster Tools and Microsoft SNDS where available.
- Iterate: address SPF/DKIM failures, update DNS, wait for TTL, re-test.
MTA-STS quick example (2026 recommended)
# mta-sts policy - serve this file from https://mta-sts.example.com/.well-known/mta-sts.txt
version: STSv1
mode: enforce
mx: mx1.example.com
mx: mx2.example.com
max_age: 604800
Also publish the DNS TXT record: _mta-sts.example.com TXT "v=STSv1; id=20260118T0000Z" and monitor TLS-RPT reports at your chosen mailbox. Consider deploying validators and telemetry collectors on resilient infrastructure as described in cloud-native architectures.
Handling bounces and feedback loops after migration
Bounces are your most direct signal. Distinguish transient (4xx) vs permanent (5xx). If a large campaign bounces, pause mailing and inspect headers.
Automated bounce parsing (example snippet for Postfix logs)
# parse-bounces.sh - rough Postfix bounce extraction
LOG=/var/log/mail.log
grep "status=bounced" $LOG | tail -n 200 > /tmp/bounced_recent.log
# Inspect the last 50 bounces
tail -n 50 /tmp/bounced_recent.log
For cloud services (SES, SendGrid), use their delivery webhooks and track bounce types. Remove hard bounces immediately from sending lists to protect sender reputation. If you automate remediation, consider using autonomous workflows with human gating for risky changes.
Advanced strategies for persistent issues
- Subdomain delegation — delegate marketing or transactional mail to subdomains (mail.example.com) with their own SPF/DKIM/DMARC, isolating reputation.
- IP warm-up — if moving to new sending IPs, sequence traffic and gradually increase volume following provider guidelines. Warm-up helps avoid ISP throttling.
- Using a relay (SMTP smart host) — route from your application to a reputable relay that handles DKIM, reputation, and bounces. Ensure envelope-from alignment or use subdomain delegation.
- ARC for forwarding — implement ARC if you run an email gateway that forwards mail, to preserve DKIM/SPF context for downstream providers. See also research on secure telemetry and how future transport telemetry may integrate with ARC-style signatures.
Sample remediation timeline (48–72 hours)
- Hour 0: Publish SPF & DKIM, DMARC p=none. Lower TTL to 300s.
- Hour 1–6: Seed tests to major providers. Collect authentication headers and initial DMARC reports.
- Hour 6–24: Fix immediate SPF includes and DKIM selector mismatches. Re-sign messages where necessary.
- Day 2: Analyze aggregated DMARC reports and bounce logs. Begin phased policy enforcement if alignment is stable.
- Day 3: Increase DMARC strictness or ramp up send volumes if IP warm-up is in progress.
Case study: migrating a SaaS domain off Gmail (real-world steps)
Context: A SaaS vendor used Gmail workspace to send transactional email. After moving to a dedicated mail provider (Postmark) and new domain, 30% of emails started landing in spam.
What we did (concise):
- Confirmed MX pointed to new provider and removed old MX records.
- Published SPF: included postmark and retained includes for other systems; flattened to keep DNS lookups under 10.
- Published DKIM selectors from Postmark and rotated their previous Gmail selector to avoid confusion; verified headers using seed accounts.
- Published DMARC p=none with aggregated rua to a parsing tool and discovered one legacy marketing platform still sending from the old domain; fixed by creating a subdomain for marketing with separate DKIM/SPF.
- Enabled MTA-STS and TLS-RPT and fixed TLS cert chain issues on the relay host revealed by reports.
Result: Deliverability recovered to 98% within 72 hours with no need to revert to Gmail.
Tools and telemetry to use in 2026
- Gmail Postmaster Tools & Google’s new deliverability dashboards (updated in 2025–26).
- Microsoft SNDS and Smart Network Data for large senders.
- DMARC aggregate collectors (commercial or open-source parsers — e.g., OpenDMARC tools).
- TLS-RPT and MTA-STS validators.
- Seed lists to test content and reputation across major ISPs.
Tip: Don’t push DMARC straight to reject after migration. Use p=none + rua and resolve all failing senders first — that is the single biggest mistake we see.
Checklist before flipping to p=reject
- All legitimate senders have SPF records that include them or have their own delegated subdomain.
- All outbound paths sign with DKIM and selectors are resolvable in DNS.
- DMARC aggregate reports show none or only known, remediable failures for 7–14 days.
- MTA-STS issued and TLS-RPT monitored for TLS transport surprises.
- Feedback loops (FBLs) configured with major ESPs and your bounce handling automations are active.
Final notes on compliance, privacy and third-party providers
In 2026, privacy and compliance requirements have tightened. When you forward DMARC forensic reports (ruf), remember they can contain sensitive content — configure access controls and retention policies. If you use third-party collectors or relay services, verify their privacy posture and ensure contractual protections for data handling. Also consider infrastructure choices and automated deployment patterns documented in IaC templates and cloud patterns for secure telemetry.
Actionable takeaways
- Diagnose first: gather bounces and header evidence before changing records.
- Fix SPF and DKIM alignment: include new senders, rotate DKIM keys to 2048-bit, and ensure From alignment.
- Gradually enforce DMARC: p=none → p=quarantine → p=reject, guided by rua reports.
- Use MTA-STS/TLS-RPT and ARC: these reduce failures caused by transport and forwarding.
- Monitor and iterate: use Postmaster tools, SNDS, DMARC reports, and seed tests — iterate on a 24–72 hour cadence during migration.
Call to action
If you’re staring at deliverability failures right now, start with the diagnostic scripts above and collect DMARC/SMTP logs for the last 72 hours. Need a tailored migration checklist or a hands-on audit for your domain(s)? Contact our expert deliverability team at pyramides.cloud — we’ll run a 48-hour audit, produce a remediation plan, and help you flip DMARC safely with minimal delivery impact. For tooling and marketplace options that help with rapid remediation, see our roundup of tools and marketplaces, and consider staged automation guarded by human review as described in autonomous agent patterns.
Related Reading
- 3 Email Templates Solar Installers Should Use (context on Gmail changes)
- Review Roundup: Tools & Marketplaces Worth Dealers’ Attention in Q1 2026
- IaC templates for automated software verification
- 3D Scanning for Perfect Ring Fit: When Tech Helps—and When It's Hype
- How to Spot Vaporware at Trade Shows: A Rider’s Guide to CES Scooter Announcements
- Designing Sovereign-Compliant CRM Hosting for EU Customers
- Registry Must-Haves for Tech-Savvy Couples: From Smart Lamps to Robot Vacuums
- Film Fans and Weather: How Studio Mergers Could Shift Tourist Seasons in Filming Hotspots
Related Topics
pyramides
Contributor
Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.
Up Next
More stories handpicked for you
From Our Network
Trending stories across our publication group