email-audit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Email Audit Sub-Skill

邮件审核子技能

Purpose

用途

Performs comprehensive email deliverability auditing for a domain. Checks DNS authentication records (SPF, DKIM, DMARC), infrastructure (MX, PTR, TLS), reputation (blacklists), and bulk sender compliance. Generates a health score (0-100) with prioritized fixes.
对域名执行全面的邮件可送达性审核。检查DNS认证记录(SPF、DKIM、DMARC)、基础设施(MX、PTR、TLS)、信誉(黑名单)以及批量发件人合规性。生成0-100分的健康评分及优先级修复建议。

Input

输入

  • Domain name: e.g.,
    rankenstein.cloud
    ,
    example.com
  • Optional: Email volume (triggers bulk sender compliance checks if 5,000+ emails/day)
  • 域名:例如
    rankenstein.cloud
    example.com
  • 可选:邮件发送量(若每日发送5000+邮件,将触发批量发件人合规检查)

Audit Categories

审核分类

1. SPF Record (Weight: 10%)

1. SPF记录(权重:10%)

What to check:
  • SPF record exists at
    TXT <domain>
  • Valid syntax: starts with
    v=spf1
  • DNS lookup count (max 10, warn at 8+)
  • Enforcement level:
    -all
    (pass),
    ~all
    (softfail),
    ?all
    (neutral),
    +all
    (fail)
  • No multiple SPF records (causes validation failure)
  • Includes are efficient and necessary
Commands:
bash
dig txt <domain> +short | grep "v=spf1"
检查内容:
  • 域名的TXT记录中存在SPF记录
  • 语法有效:以
    v=spf1
    开头
  • DNS查询次数(最多10次,8次及以上发出警告)
  • 执行级别:
    -all
    (通过)、
    ~all
    (软失败)、
    ?all
    (中性)、
    +all
    (失败)
  • 无多条SPF记录(会导致验证失败)
  • 包含的域高效且必要
命令:
bash
dig txt <domain> +short | grep "v=spf1"

or

python scripts/check_deliverability.py <domain> --spf

**Scoring:**
- Valid + hard fail (`-all`): 100 points
- Valid + soft fail (`~all`): 70 points
- Valid + neutral/pass all: 40 points
- Invalid syntax or 10+ lookups: 20 points
- Missing: 0 points
python scripts/check_deliverability.py <domain> --spf

**评分标准:**
- 有效且硬失败(`-all`):100分
- 有效且软失败(`~all`):70分
- 有效且中性/允许所有:40分
- 语法无效或查询次数≥10:20分
- 缺失:0分

2. DKIM Record (Weight: 15%)

2. DKIM记录(权重:15%)

What to check:
  • At least one valid DKIM record exists
  • Key length: 2048-bit (required minimum per NIST), 1024-bit (legacy, upgrade recommended)
  • Common selectors:
    google
    ,
    default
    ,
    selector1
    ,
    selector2
    ,
    k1
    ,
    mandrill
    ,
    dkim
Commands:
bash
dig txt google._domainkey.<domain> +short
dig txt default._domainkey.<domain> +short
dig txt selector1._domainkey.<domain> +short
检查内容:
  • 至少存在一条有效的DKIM记录
  • 密钥长度:2048位(NIST要求的最低标准),1024位(旧版,建议升级)
  • 常见选择器:
    google
    default
    selector1
    selector2
    k1
    mandrill
    dkim
命令:
bash
dig txt google._domainkey.<domain> +short
dig txt default._domainkey.<domain> +short
dig txt selector1._domainkey.<domain> +short

Check common selectors

检查常见选择器


**Note:** DKIM selectors are not discoverable without prior knowledge. Check common ones and ask user if their email provider uses a specific selector.

**Scoring:**
- 2048-bit key found: 100 points
- 1024-bit key found: 70 points
- Invalid/weak key: 30 points
- Missing: 0 points

**注意:** DKIM选择器无法主动发现,需检查常见选择器,若用户的邮件服务商使用特定选择器,可询问用户。

**评分标准:**
- 找到2048位密钥:100分
- 找到1024位密钥:70分
- 密钥无效/强度弱:30分
- 缺失:0分

3. DMARC Policy (Weight: 15%)

3. DMARC策略(权重:15%)

What to check:
  • DMARC record exists at
    TXT _dmarc.<domain>
  • Policy level:
    p=reject
    (excellent),
    p=quarantine
    (good),
    p=none
    (monitoring)
  • Aggregate reporting (
    rua=
    ) tag present
  • Forensic reporting (
    ruf=
    ) tag present (optional)
  • Alignment mode:
    aspf=
    (SPF) and
    adkim=
    (DKIM) - relaxed vs strict
  • Percentage (
    pct=
    ) should be 100 for full enforcement
Commands:
bash
dig txt _dmarc.<domain> +short
Scoring:
  • p=reject
    +
    rua
    +
    pct=100
    : 100 points
  • p=quarantine
    +
    rua
    : 80 points
  • p=none
    +
    rua
    : 40 points
  • p=none
    without reporting: 20 points
  • Missing: 0 points
检查内容:
  • _dmarc.<domain>
    的TXT记录中存在DMARC记录
  • 策略级别:
    p=reject
    (优秀)、
    p=quarantine
    (良好)、
    p=none
    (监控)
  • 存在聚合报告(
    rua=
    )标签
  • 存在取证报告(
    ruf=
    )标签(可选)
  • 对齐模式:
    aspf=
    (SPF)和
    adkim=
    (DKIM)- 宽松 vs 严格
  • 百分比(
    pct=
    )应设为100以实现全面执行
命令:
bash
dig txt _dmarc.<domain> +short
评分标准:
  • p=reject
    +
    rua
    +
    pct=100
    :100分
  • p=quarantine
    +
    rua
    :80分
  • p=none
    +
    rua
    :40分
  • p=none
    且无报告:20分
  • 缺失:0分

4. MX Records (Weight: 10%)

4. MX记录(权重:10%)

What to check:
  • Valid MX records exist
  • MX hosts resolve to IP addresses
  • Priority ordering is logical
  • Mail provider identification (Google Workspace, Microsoft 365, custom)
Commands:
bash
dig mx <domain> +short
dig a <mx-hostname> +short
Scoring:
  • Valid + all hosts resolve + known provider: 100 points
  • Valid + all hosts resolve: 80 points
  • Valid but some hosts don't resolve: 40 points
  • Missing or invalid: 0 points
检查内容:
  • 存在有效的MX记录
  • MX主机可解析为IP地址
  • 优先级排序合理
  • 识别邮件服务商(Google Workspace、Microsoft 365、自定义)
命令:
bash
dig mx <domain> +short
dig a <mx-hostname> +short
评分标准:
  • 有效且所有主机可解析且为已知服务商:100分
  • 有效且所有主机可解析:80分
  • 有效但部分主机无法解析:40分
  • 缺失或无效:0分

5. Reverse DNS / PTR (Weight: 5%)

5. 反向DNS / PTR(权重:5%)

What to check:
  • PTR records exist for MX server IPs
  • PTR records match forward DNS (hostname matches)
Commands:
bash
dig -x <mx-ip> +short
Scoring:
  • All MX IPs have matching PTR: 100 points
  • Partial PTR coverage: 50 points
  • Missing PTR: 0 points
检查内容:
  • MX服务器IP存在PTR记录
  • PTR记录与正向DNS匹配(主机名一致)
命令:
bash
dig -x <mx-ip> +short
评分标准:
  • 所有MX IP均有匹配的PTR记录:100分
  • 部分PTR覆盖:50分
  • 缺失PTR记录:0分

6. TLS/STARTTLS (Weight: 10%)

6. TLS/STARTTLS(权重:10%)

What to check:
  • STARTTLS support on MX servers (port 25)
  • TLS version (1.2+ recommended)
Commands:
bash
openssl s_client -starttls smtp -connect <mx-hostname>:25 -brief
Note: This may require network access. If not available, note as "Unable to verify".
Scoring:
  • TLS 1.2+ with STARTTLS: 100 points
  • TLS 1.0/1.1 with STARTTLS: 60 points
  • No STARTTLS: 0 points
检查内容:
  • MX服务器支持STARTTLS(25端口)
  • TLS版本(建议1.2+)
命令:
bash
openssl s_client -starttls smtp -connect <mx-hostname>:25 -brief
注意: 此检查可能需要网络访问。若无法访问,标注为“无法验证”。
评分标准:
  • 支持STARTTLS且TLS版本为1.2+:100分
  • 支持STARTTLS但TLS版本为1.0/1.1:60分
  • 不支持STARTTLS:0分

7. Blacklist Check (Weight: 20%)

7. 黑名单检查(权重:20%)

What to check:
  • Domain and MX IP addresses against major blacklists:
    • Spamhaus (SBL, XBL, PBL)
    • Barracuda
    • SORBS
    • SpamCop
    • URIBL
    • Invaluement
Commands:
bash
undefined
检查内容:
  • 域名和MX IP在主要黑名单中的状态:
    • Spamhaus(SBL、XBL、PBL)
    • Barracuda
    • SORBS
    • SpamCop
    • URIBL
    • Invaluement
命令:
bash
undefined

Use checkdmarc library if available

若有checkdmarc库则使用

python -c "import checkdmarc; print(checkdmarc.check_domains(['<domain>']))"
python -c "import checkdmarc; print(checkdmarc.check_domains(['<domain>']))"

Or manual checks

或手动检查

dig <ip>.zen.spamhaus.org +short dig <ip>.b.barracudacentral.org +short

**Scoring:**
- Clean on all lists: 100 points
- Listed on 1 minor list: 50 points
- Listed on 1 major list (Spamhaus, Barracuda): 30 points
- Listed on 2+ major lists: 0 points

**Critical:** Any listing on major blacklists severely impacts deliverability.
dig <ip>.zen.spamhaus.org +short dig <ip>.b.barracudacentral.org +short

**评分标准:**
- 所有列表中均无记录:100分
- 仅在1个次要黑名单中:50分
- 在1个主要黑名单(Spamhaus、Barracuda)中:30分
- 在2个及以上主要黑名单中:0分

**关键提示:** 任何主要黑名单的记录都会严重影响邮件可送达性。

8. Bulk Sender Compliance (Weight: 10%)

8. 批量发件人合规性(权重:10%)

Applies to: Domains sending 5,000+ emails/day to Gmail, Yahoo, Microsoft recipients.
Requirements (Google/Yahoo/Microsoft 2024-2026 rules):
  1. Both SPF AND DKIM must pass (not just one)
  2. DMARC policy at minimum
    p=none
    with alignment
  3. One-click unsubscribe header (RFC 8058:
    List-Unsubscribe-Post: One-Click
    )
  4. Spam complaint rate under 0.3% (target under 0.1%)
  5. Valid forward and reverse DNS (PTR records)
  6. Honor unsubscribe within 2 business days
  7. No impersonation of Gmail/Yahoo/Microsoft from headers
  8. TLS connection for message transmission
Scoring:
  • All 8 requirements met: 100 points
  • 6-7 requirements met: 70 points
  • 4-5 requirements met: 50 points
  • Less than 4 met: 0 points
适用场景: 每日向Gmail、Yahoo、Microsoft收件人发送5000+邮件的域名。
要求(Google/Yahoo/Microsoft 2024-2026规则):
  1. SPF和DKIM必须同时通过(不能仅通过其一)
  2. DMARC策略至少为
    p=none
    且对齐
  3. 一键退订头信息(RFC 8058:
    List-Unsubscribe-Post: One-Click
  4. 垃圾邮件投诉率低于0.3%(目标低于0.1%)
  5. 有效的正向和反向DNS(PTR记录)
  6. 2个工作日内处理退订请求
  7. 不得在头信息中冒充Gmail/Yahoo/Microsoft
  8. 邮件传输使用TLS连接
评分标准:
  • 满足所有8项要求:100分
  • 满足6-7项要求:70分
  • 满足4-5项要求:50分
  • 满足少于4项要求:0分

9. Additional Checks (Weight: 5%)

9. 额外检查(权重:5%)

Bonus points for:
  • BIMI record (Brand Indicators for Message Identification) at
    TXT default._bimi.<domain>
  • MTA-STS policy at
    https://mta-sts.<domain>/.well-known/mta-sts.txt
  • TLSRPT record at
    TXT _smtp._tls.<domain>
    (TLS reporting)
  • Mail-from domain alignment (DKIM/SPF align with From: domain)
Commands:
bash
dig txt default._bimi.<domain> +short
curl https://mta-sts.<domain>/.well-known/mta-sts.txt
dig txt _smtp._tls.<domain> +short
Scoring:
  • Each bonus feature: +25 points (max 100)
加分项:
  • BIMI记录(品牌标识消息认证)位于
    TXT default._bimi.<domain>
  • MTA-STS策略位于
    https://mta-sts.<domain>/.well-known/mta-sts.txt
  • TLSRPT记录位于
    TXT _smtp._tls.<domain>
    (TLS报告)
  • 发件人域名对齐(DKIM/SPF与From:域名对齐)
命令:
bash
dig txt default._bimi.<domain> +short
curl https://mta-sts.<domain>/.well-known/mta-sts.txt
dig txt _smtp._tls.<domain> +short
评分标准:
  • 每个额外功能:+25分(最高100分)

Health Score Calculation

健康评分计算

Formula:
Total Score = (SPF × 0.10) + (DKIM × 0.15) + (DMARC × 0.15) + (MX × 0.10) +
              (PTR × 0.05) + (TLS × 0.10) + (Blacklists × 0.20) +
              (Bulk Compliance × 0.10) + (Extras × 0.05)
Score Interpretation:
ScoreRatingStatusAction
90-100ExcellentAll critical checks pass, fully compliantMonitor regularly
75-89GoodMinor issues, generally deliverableFix medium priority items
60-74FairIssues that could impact inbox placementFix high priority items within 1 week
40-59PoorSignificant deliverability risksFix critical items immediately
0-39CriticalMajor issues, emails likely going to spamEmergency fixes required
公式:
总分 = (SPF得分 × 0.10) + (DKIM得分 × 0.15) + (DMARC得分 × 0.15) + (MX得分 × 0.10) +
      (PTR得分 × 0.05) + (TLS得分 × 0.10) + (黑名单得分 × 0.20) +
      (批量合规得分 × 0.10) + (额外项得分 × 0.05)
评分解读:
分数范围评级状态行动建议
90-100优秀所有关键检查通过,完全合规定期监控
75-89良好存在轻微问题,邮件通常可送达修复中等优先级问题
60-74一般存在可能影响收件箱投递的问题1周内修复高优先级问题
40-59较差存在严重的可送达性风险立即修复关键问题
0-39危急存在重大问题,邮件大概率进入垃圾邮箱需要紧急修复

Workflow

工作流程

Step 1: Gather Domain Information

步骤1:收集域名信息

Ask user for:
  • Domain name to audit
  • Approximate email volume (to trigger bulk sender checks)
  • Known DKIM selector (if not using common ones)
向用户询问:
  • 需审核的域名
  • 大致邮件发送量(触发批量发件人检查)
  • 已知的DKIM选择器(若未使用常见选择器)

Step 2: Parallel Delegation

步骤2:并行委派

Spawn these agents in parallel for faster auditing:
Agent 1: email-deliverability
Check DNS authentication records for <domain>:
- SPF record validation
- DKIM record discovery (selectors: google, default, selector1, selector2, k1)
- DMARC policy analysis
- MX record validation
- PTR/reverse DNS check

Return JSON with pass/fail status and raw records.
Agent 2: email-compliance
Check bulk sender compliance for <domain>:
- Verify both SPF and DKIM pass
- Check DMARC alignment
- Note TLS support
- Check for List-Unsubscribe headers (if sample email provided)

Return compliance checklist with met/not met status.
Agent 3: email-reputation (if tools available)
Check reputation for <domain>:
- Blacklist status (Spamhaus, Barracuda, SORBS, SpamCop)
- Historical deliverability issues
- Spam complaint rate (if available)

Return list of blacklist hits and reputation score.
并行启动以下代理以加快审核速度:
代理1:email-deliverability
检查<domain>的DNS认证记录:
- SPF记录验证
- DKIM记录发现(选择器:google、default、selector1、selector2、k1)
- DMARC策略分析
- MX记录验证
- PTR/反向DNS检查

返回包含通过/失败状态及原始记录的JSON。
代理2:email-compliance
检查<domain>的批量发件人合规性:
- 验证SPF和DKIM均通过
- 检查DMARC对齐情况
- 记录TLS支持情况
- 检查List-Unsubscribe头信息(若提供样本邮件)

返回包含符合/不符合状态的合规检查表。
代理3:email-reputation(若工具可用)
检查<domain>的信誉:
- 黑名单状态(Spamhaus、Barracuda、SORBS、SpamCop)
- 历史可送达性问题
- 垃圾邮件投诉率(若可用)

返回黑名单命中列表及信誉评分。

Step 3: Aggregate Results

步骤3:汇总结果

Collect results from all agents and calculate weighted health score.
收集所有代理的结果,计算加权健康评分。

Step 4: Generate Prioritized Fix List

步骤4:生成优先级修复列表

Categorize issues by priority:
Critical (Fix Immediately):
  • Blacklist listings
  • Missing SPF/DKIM/DMARC
  • Invalid DNS records
  • MX records not resolving
High (Fix Within 1 Week):
  • Weak SPF enforcement (
    ~all
    instead of
    -all
    )
  • 1024-bit DKIM keys (upgrade to 2048-bit)
  • DMARC policy
    p=none
    (upgrade to
    p=quarantine
    or
    p=reject
    )
  • Missing PTR records
Medium (Fix Within 1 Month):
  • Missing aggregate reporting (
    rua
    tag)
  • No TLS/STARTTLS support
  • SPF approaching 10 DNS lookup limit
  • Missing bonus features (BIMI, MTA-STS, TLSRPT)
按优先级对问题分类:
危急(立即修复):
  • 黑名单记录
  • 缺失SPF/DKIM/DMARC
  • DNS记录无效
  • MX记录无法解析
高优先级(1周内修复):
  • SPF执行强度弱(使用
    ~all
    而非
    -all
  • 1024位DKIM密钥(升级至2048位)
  • DMARC策略为
    p=none
    (升级至
    p=quarantine
    p=reject
  • 缺失PTR记录
中优先级(1个月内修复):
  • 缺失聚合报告(
    rua
    标签)
  • 不支持TLS/STARTTLS
  • SPF查询次数接近10次上限
  • 缺失额外功能(BIMI、MTA-STS、TLSRPT)

Step 5: Generate DNS Record Recommendations

步骤5:生成DNS记录建议

Provide exact DNS records to add/update with copy-paste ready values.
提供可直接复制粘贴的需添加/更新的DNS记录。

Output Format

输出格式

Structure the audit report as:
  1. Header:
    ## Email Deliverability Audit: [domain]
    with date, health score, rating
  2. Authentication table: SPF/DKIM/DMARC with status, score, raw records
  3. Infrastructure table: MX/PTR/TLS with status, score, provider detection
  4. Reputation: Blacklist status across Spamhaus, Barracuda, SORBS, SpamCop
  5. Bulk Sender Compliance: 8-requirement checklist (Google/Yahoo/Microsoft rules)
  6. Bonus Features: BIMI, MTA-STS, TLSRPT, Mail-from alignment
  7. Prioritized Fix List: Critical/High/Medium with impact, fix steps, DNS records
  8. DNS Records to Add: Copy-paste ready TXT/MX records
  9. Next Steps: Immediate, this week, this month, monitoring, re-audit
Use score weights from Health Score Calculation section. Use status badges: ✅ PASS, ⚠️ WARN, ❌ FAIL.
审核报告结构如下:
  1. 标题
    ## 邮件可送达性审核:[domain]
    ,包含日期、健康评分、评级
  2. 认证表格:SPF/DKIM/DMARC的状态、得分、原始记录
  3. 基础设施表格:MX/PTR/TLS的状态、得分、服务商检测结果
  4. 信誉:Spamhaus、Barracuda、SORBS、SpamCop的黑名单状态
  5. 批量发件人合规性:8项要求的检查表(Google/Yahoo/Microsoft规则)
  6. 额外功能:BIMI、MTA-STS、TLSRPT、发件人域名对齐情况
  7. 优先级修复列表:危急/高/中优先级,包含影响、修复步骤、DNS记录
  8. 需添加的DNS记录:可直接复制粘贴的TXT/MX记录
  9. 下一步行动:立即、本周、本月、监控、重新审核
使用健康评分计算部分的权重。使用状态标识:✅ 通过,⚠️ 警告,❌ 失败。

Tools

工具

Run
python scripts/check_deliverability.py <domain> --json
for automated DNS checks.
Manual DNS commands (used in audit categories above):
  • SPF:
    dig txt <domain> +short
  • DKIM:
    dig txt <selector>._domainkey.<domain> +short
  • DMARC:
    dig txt _dmarc.<domain> +short
  • MX:
    dig mx <domain> +short
  • PTR:
    dig -x <ip> +short
  • TLS:
    openssl s_client -starttls smtp -connect <mx-hostname>:25 -brief
运行
python scripts/check_deliverability.py <domain> --json
进行自动化DNS检查。
手动DNS命令(用于上述审核分类):
  • SPF:
    dig txt <domain> +short
  • DKIM:
    dig txt <selector>._domainkey.<domain> +short
  • DMARC:
    dig txt _dmarc.<domain> +short
  • MX:
    dig mx <domain> +short
  • PTR:
    dig -x <ip> +short
  • TLS:
    openssl s_client -starttls smtp -connect <mx-hostname>:25 -brief

Quality Gates

质量门

Before delivering audit results:
  1. All critical checks completed (SPF, DKIM, DMARC, MX, Blacklists)
  2. Health score calculated with breakdown by category
  3. Prioritized fix list generated with specific action steps
  4. DNS records provided in copy-paste ready format
  5. Score interpretation explained with next steps
在交付审核结果前需满足:
  1. 完成所有关键检查(SPF、DKIM、DMARC、MX、黑名单)
  2. 计算健康评分并按分类细分
  3. 生成优先级修复列表并包含具体操作步骤
  4. 提供可直接使用的DNS记录
  5. 解释评分含义并给出下一步行动建议

Error Handling

错误处理

If DNS queries fail:
  • Note as "Unable to verify" in audit report
  • Provide manual check instructions
  • Suggest alternative DNS servers (8.8.8.8, 1.1.1.1)
If DKIM selector unknown:
  • Check common selectors (google, default, selector1, selector2)
  • Ask user for their email provider's DKIM selector
  • Note as "DKIM selector not found - requires manual verification"
If no MX records found:
  • Critical failure - domain cannot receive email
  • Check if domain uses mail forwarding (Cloudflare, etc.)
  • Provide setup instructions for email hosting
若DNS查询失败:
  • 在审核报告中标注“无法验证”
  • 提供手动检查说明
  • 建议使用替代DNS服务器(8.8.8.8、1.1.1.1)
若DKIM选择器未知:
  • 检查常见选择器(google、default、selector1、selector2)
  • 询问用户其邮件服务商的DKIM选择器
  • 标注为“未找到DKIM选择器 - 需要手动验证”
若未找到MX记录:
  • 严重失败 - 域名无法接收邮件
  • 检查域名是否使用邮件转发服务(如Cloudflare等)
  • 提供邮件托管的设置说明

References

参考资料

Load on demand:
  • references/deliverability-rules.md
    - Scoring thresholds and compliance rules
  • references/mcp-integration.md
    - Provider-specific setup and DNS configuration
  • references/compliance.md
    - Compliance rules and regulatory requirements
按需加载:
  • references/deliverability-rules.md
    - 评分阈值和合规规则
  • references/mcp-integration.md
    - 服务商特定设置和DNS配置
  • references/compliance.md
    - 合规规则和监管要求

Success Criteria

成功标准

Audit is successful when:
  • Health score accurately reflects deliverability state
  • All critical issues identified with clear severity levels
  • User receives actionable DNS records to implement
  • Fix priority aligns with business impact
  • Re-audit timeframe provided based on score
审核成功的条件:
  • 健康评分准确反映可送达性状态
  • 所有关键问题均已识别并明确严重级别
  • 用户收到可执行的DNS记录
  • 修复优先级与业务影响匹配
  • 根据评分提供重新审核的时间框架