email-deliverability-debugger
Diagnoses email deliverability problems for transactional and marketing emails. Checks SPF/DKIM/DMARC alignment, sending IP reputation, email content spam triggers, and bounce patterns. Use when emails land in spam, go missing, or bounce unexpectedly. Trigger words: email spam, deliverability, emails not arriving, bounce rate, spam folder, email reputation, SPF fail, DKIM fail, DMARC, transactional email, SendGrid, Postmark, SES.
What this skill does
# Email Deliverability Debugger
## Overview
This skill systematically diagnoses why emails fail to reach inboxes by checking the entire delivery chain: DNS authentication (SPF, DKIM, DMARC), sending IP reputation, email content, headers, and provider-specific configuration. It produces actionable fixes ranked by impact.
## Instructions
### Step 1: Check DNS Authentication Records
```bash
# SPF record
dig +short TXT example.com | grep "v=spf1"
# DKIM (check common selectors)
for sel in s1 s2 k1 google default sendgrid; do
dig +short TXT ${sel}._domainkey.example.com
done
# DMARC
dig +short TXT _dmarc.example.com
```
Validate each:
- **SPF**: Must include all sending services, ≤10 DNS lookups, end with `-all` (hardfail)
- **DKIM**: Each sending service needs its own selector with valid key
- **DMARC**: Should have `p=quarantine` or `p=reject`; `p=none` provides no protection
### Step 2: Count SPF Lookups
SPF has a hard limit of 10 DNS lookups. Count each `include:`, `a:`, `mx:`, and `redirect=` as 1 lookup. Nested includes count too.
```bash
# Check SPF record and count includes
dig +short TXT example.com | grep spf
# Then recursively check each include
dig +short TXT _spf.google.com
dig +short TXT sendgrid.net
```
If at or near 10, recommend SPF flattening or removing unused services.
### Step 3: Analyze Email Headers (if provided)
Key headers to check:
- `Authentication-Results`: Shows SPF, DKIM, DMARC pass/fail
- `X-MS-Exchange-Organization-SCL`: Microsoft spam confidence (0-9, >5 = spam)
- `X-Spam-Score`: Generic spam score
- `Received-SPF`: SPF result with detail
- `DKIM-Signature`: Which domain signed and which selector used
- `Return-Path`: Must align with `From` domain for SPF alignment
### Step 4: Check IP Reputation
Query major blacklists:
```bash
# Reverse IP for DNSBL queries (e.g., 1.2.3.4 becomes 4.3.2.1)
REVERSED="4.3.2.1"
for bl in zen.spamhaus.org b.barracudacentral.org bl.spamcop.net; do
dig +short ${REVERSED}.${bl}
done
# Non-empty result = listed on that blacklist
```
Common blacklists to check: Spamhaus, Barracuda, SpamCop, SORBS, CBL, URIBL.
### Step 5: Check Content Issues
Flag common spam triggers:
- Subject line with ALL CAPS or excessive punctuation (!!!)
- HTML-only email without text/plain alternative
- High image-to-text ratio
- URL shorteners (bit.ly, etc.) in email body
- Missing unsubscribe header (required for bulk, good practice for all)
- Missing `List-Unsubscribe` header
### Step 6: Produce Fix Report
Organize by priority:
1. **Critical**: Authentication failures (SPF/DKIM/DMARC fail)
2. **High**: IP blacklisting
3. **Medium**: Content issues, missing headers
4. **Low**: Best practice improvements
Include exact DNS records to add/modify and provider-specific configuration steps.
## Examples
### Example 1: Full Deliverability Audit
**User prompt:**
```
Our emails to Gmail users are going to spam. Domain: notifications.myapp.com
```
**Agent output:**
```
Deliverability Audit — notifications.myapp.com
❌ CRITICAL: DMARC alignment failure
From: notifications.myapp.com
Return-Path: bounces.sendgrid.net (different domain)
→ SPF passes for sendgrid.net but doesn't align with From domain
Fix: Configure SendGrid authenticated domain so Return-Path uses your domain
⚠ HIGH: DMARC policy too weak
Current: v=DMARC1; p=none
→ Gmail honors DMARC but p=none means failures aren't acted on
Fix: v=DMARC1; p=quarantine; rua=mailto:[email protected]; pct=100
✅ SPF: Valid (7 lookups)
✅ DKIM: Valid (s1 selector, 2048-bit)
✅ IP reputation: Clean on all major blacklists
Priority fix order:
1. Configure SendGrid domain authentication (fixes Return-Path alignment)
2. Update DMARC to p=quarantine
3. Monitor DMARC reports for 2 weeks before moving to p=reject
```
### Example 2: Specific Bounce Diagnosis
**User prompt:**
```
Getting 550 5.7.1 rejections from outlook.com. What's wrong?
```
**Agent output:**
```
550 5.7.1 from Outlook = message rejected due to content or policy
Diagnosis checklist:
1. ✅ SPF passes for your domain
2. ❌ DKIM signature uses d=sendgrid.net, not your domain
→ Microsoft strict mode rejects misaligned DKIM
3. ❌ Your sending IP 149.72.x.x is on Spamhaus PBL
→ This is a policy listing, not spam — means IP is flagged as dynamic/cloud
Fixes:
1. Set up DKIM custom domain in SendGrid (Settings → Sender Authentication)
Add CNAMEs: s1._domainkey.yourdomain.com → s1.domainkey.u1234.wl.sendgrid.net
2. Request Spamhaus PBL removal at spamhaus.org/pbl/query/
3. After fixes, use mail-tester.com to verify score >8/10 before bulk sending
```
## Guidelines
- **Check authentication FIRST** — 80% of deliverability issues are DNS authentication failures
- **Alignment matters more than pass/fail** — SPF can pass but still fail DMARC if domains don't align
- **Separate transactional from marketing** — different subdomains and IPs protect transactional reputation
- **DMARC reports are gold** — always recommend setting up `rua` aggregate reports
- **Don't recommend p=reject immediately** — go none → quarantine → reject over 4-6 weeks while monitoring
- **IP reputation recovers slowly** — blacklist removal is quick, but reputation rebuilding takes 2-4 weeks of clean sending
- **Test with real recipients** — mail-tester.com, Gmail postmaster tools, and Microsoft SNDS are free and essential
Related in Productivity
gitea-workflow
IncludedOrchestrate agile development workflows for Gitea repositories using the tea CLI. Use when working with Gitea-hosted repos and asking to 'run the workflow', 'continue working', 'what's next', 'complete the task cycle', 'start my day', 'end the sprint', 'implement the next task', or wanting guided step-by-step development assistance. Keywords: workflow, orchestrate, agile, task cycle, sprint, daily, implement, review, PR, standup, retrospective, gitea, tea.
microsoft-graph-gateway
IncludedRoute Microsoft Graph work in this workspace. Use when users want to read or write Outlook mail, calendar events, contacts, OneDrive or SharePoint files, Teams, Planner, To Do, users, groups, directory data, or arbitrary Microsoft Graph endpoints from VS Code. Prefer WorkIQ for common read scenarios. Use Microsoft Graph for write actions and gap-read scenarios that need exact Graph properties, filters, permissions, or endpoints.
copilotkit
IncludedUse when building with CopilotKit — setup, development, integrations, debugging, upgrading, or contributing. Routes to the appropriate specialized skill based on the task.
wordly-wisdom
IncludedProvides calibrated decision analysis using Charlie Munger-style multiple mental models, inversion, incentive mapping, circle-of-competence checks, misjudgment audits, second-order effects, and forecast updates. Use when the user asks for an oracle take, a hard call, a decision memo, a premortem, an outside view, a red-team, a sanity-check, what am I missing, think this through, or wants a strategy, hire, investment, plan, product, partnership, or major life choice analysed. Avoid for simple factual lookups or time-sensitive legal, medical, or market questions without fresh evidence.
swain-session
IncludedSession management and project status dashboard. Owns the full session lifecycle (start/work/close/resume), focus lane, bookmarks, worktree detection, and tab naming. Also serves as the project status dashboard — shows active epics, progress, actionable next steps, blocked items, tasks, GitHub issues, and recommendations. Worktree creation is deferred to swain-do task dispatch (SPEC-195). Triggers on: 'session', 'status', 'what's next', 'dashboard', 'overview', 'where are we', 'what should I work on', 'show me priorities', 'bookmark', 'focus on', 'session info'.
gandi
IncludedComprehensive Gandi domain registrar integration for domain and DNS management. Register and manage domains, create/update/delete DNS records (A, AAAA, CNAME, MX, TXT, SRV, and more), configure email forwarding and aliases, check SSL certificate status, create DNS snapshots for safe rollback, bulk update zone files, and monitor domain expiration. Supports multi-domain management, zone file import/export, and automated DNS backups. Includes both read-only and destructive operations with safety controls.