When to Use
Use this skill when the user needs to configure, test, send, or debug outbound email over SMTP.
It is for submission and delivery work: provider setup, ports and TLS, auth failures, relay denials, canary sends, bounce interpretation, and inbox-placement diagnosis.
Architecture
Memory lives in ~/smtp/. If ~/smtp/ does not exist, run setup.md. Use memory-template.md, memory.md, provider-profiles.md, send-log.md, and deliverability-notes.md as the local baseline.
CODEBLOCK0
Quick Reference
| Topic | File | Use it for |
|---|
| Setup and first-run guardrails | INLINECODE8 | Initialize ~/smtp/ without storing secrets or sending mail too early |
| Memory structure |
memory-template.md | Create
~/smtp/memory.md with status and stable context |
| Baseline memory example |
memory.md | Show the expected shape of a live SMTP memory file |
| Provider profile baseline |
provider-profiles.md | Track approved providers, ports, auth modes, and sender identities |
| Send decision log baseline |
send-log.md | Record dry runs, canaries, queue IDs, and verification evidence |
| Deliverability notes baseline |
deliverability-notes.md | Capture DNS auth status, spam-folder evidence, and bounce patterns |
| Safe execution workflow |
send-flow.md | Run draft -> preflight -> canary -> verify -> scale |
| Fault isolation guide |
diagnostic-playbook.md | Separate DNS, TLS, auth, relay, and placement failures |
| Deliverability rules |
deliverability.md | Check SPF, DKIM, DMARC, alignment, and inbox placement |
| CLI probe patterns |
swaks-recipes.md | Use deterministic SMTP tests with placeholder-only examples |
Requirements
- - SMTP host access only when the user wants real network testing or live sending.
- Credentials must come from a user-approved secret source at runtime, never from files under
~/smtp/. - Recommended tools:
swaks for SMTP probes, openssl for TLS inspection, and dig or nslookup for DNS checks. - Explicit confirmation before any live send, external-recipient test, or multi-recipient action.
Core Rules
1. Separate Draft, Probe, and Live Send
- - Decide which mode the task is in before touching the network: draft-only, connectivity probe, auth probe, canary send, or live send.
- Draft and explain first. Do not jump from "help me configure SMTP" to "message sent."
2. Match Port, TLS, and Auth Exactly
- - Port 465 means implicit TLS. Port 587 usually means STARTTLS. Port 25 is relay transport and is often blocked or policy-limited.
- Treat host, port, TLS mode, and auth mechanism as one contract. A single mismatch can look like a generic timeout or auth error.
3. Debug One Layer at a Time
- - Validate in order: DNS and hostname, TCP reachability, TLS handshake, EHLO capabilities, auth, submission response, then mailbox placement.
- Do not tweak deliverability records before proving the connection and auth layers are healthy.
4. Keep Sender Identity Aligned
- - Check whether the authenticated account, envelope sender, visible From address, DKIM domain, and return-path domain actually belong together.
- Misalignment often produces 550/553 rejections, spam placement, or "sent successfully" with no inbox result.
5. Canary Before Scale
- - The first live test should target one approved canary recipient, ideally on the same org or a controlled inbox.
- Only widen recipients after you have queue acceptance, message ID evidence, and inbox-or-spam confirmation.
6. Handle Credentials and Logs Safely
- - Never write raw SMTP passwords, API tokens, or full secrets into
~/smtp/. - Redact logs and screenshots before storing or sharing them. Keep only the smallest evidence needed to debug.
7. Acceptance Is Not Delivery
- - A
250 queued or similar server response means the SMTP server accepted the message, not that the recipient inbox accepted it. - Always verify final state through bounce evidence, mailbox placement, or downstream provider logs when available.
Common Traps
| Trap | Why It Fails | Better Move |
|---|
| Treating port 465 and 587 as interchangeable | TLS handshake breaks or auth never starts | Match implicit TLS vs STARTTLS explicitly |
| Changing SPF before fixing auth |
Wrong layer, no effect on login failure | Prove DNS, TLS, and auth separately |
| Assuming
250 means inbox success | Queue acceptance is not mailbox placement | Check spam, bounces, and final recipient evidence |
| Using external recipients as the first test | Increases blast radius and risk | Start with one approved canary inbox |
| Disabling certificate checks to "make it work" | Hides real TLS or hostname issues | Fix hostname, CA trust, or port selection instead |
| Letting From differ wildly from auth identity | Triggers relay denial or spam scoring | Align sender identity or document the relay policy |
External Endpoints
| Endpoint | Data Sent | Purpose |
|---|
| Configured SMTP submission server, such as INLINECODE28 | Message headers, recipients, body, and attachments only for approved live tests or sends | Submit or test outbound mail |
| DNS resolvers or authoritative nameservers for the sender domain |
Domain names and record lookups for SPF, DKIM, DMARC, MX, and PTR checks | Diagnose deliverability and domain alignment |
No other data should be sent externally unless the user explicitly approves broader tooling.
Data Storage
Local state in ~/smtp/ includes:
- - activation state, approved providers, and safety defaults in INLINECODE30
- known-good server profiles and sender-identity notes in INLINECODE31
- dry-run decisions, canary evidence, and message IDs in INLINECODE32
- domain-auth and placement findings in INLINECODE33
Security & Privacy
Data that leaves your machine:
- - SMTP envelope and message content only during approved probes or live sends
- DNS queries needed to validate sender-domain health and routing
Data that stays local:
- - safe defaults and approved provider context in INLINECODE34
- known-good provider settings and debugging evidence in
~/smtp/provider-profiles.md, ~/smtp/send-log.md, and INLINECODE37
This skill does NOT:
- - send live mail without explicit confirmation
- store raw SMTP passwords or tokens in local memory
- modify DNS records, mailing lists, or provider settings unless the user explicitly asks
- disable TLS verification silently
- modify its own skill definition
Trust
By using this skill, approved message content is sent to the configured SMTP provider and related DNS infrastructure.
Only install and run it if you trust those providers with your outbound mail flow.
Scope
This skill ONLY:
- - helps configure and diagnose outbound SMTP submission
- maintains small local notes in INLINECODE38
- runs canary-first send workflows with explicit confirmation gates
This skill NEVER:
- - guess live-send approval from vague user intent
- keep credentials in INLINECODE39
- treat queue acceptance as the final delivery result
- broaden a one-off test into a bulk-send workflow without consent
Related Skills
Install with
clawhub install <slug> if user confirms:
- -
mail - broader mailbox operations across IMAP, SMTP, and Apple Mail workflows - INLINECODE42 - deeper DNS record work for SPF, DKIM, DMARC, MX, and TTL changes
- INLINECODE43 - port reachability, TLS, and connection debugging beyond mail workflows
- INLINECODE44 - message design and campaign structure once SMTP delivery is healthy
- INLINECODE45 - deliverability and audience strategy after the send path is stable
Feedback
- - If useful: INLINECODE46
- Stay updated: INLINECODE47
何时使用
当用户需要通过SMTP配置、测试、发送或调试出站邮件时,使用此技能。
它适用于提交和投递工作:提供商设置、端口和TLS、认证失败、中继拒绝、金丝雀发送、退信解读以及收件箱投递诊断。
架构
记忆存储在~/smtp/目录中。如果~/smtp/不存在,请运行setup.md。使用memory-template.md、memory.md、provider-profiles.md、send-log.md和deliverability-notes.md作为本地基线。
text
~/smtp/
├── memory.md # 状态、已批准的提供商、域名和安全默认值
├── provider-profiles.md # 已知良好的主机、端口、认证模式和发件人身份说明
├── send-log.md # 预演决策、金丝雀发送、消息ID和结果
└── deliverability-notes.md # SPF、DKIM、DMARC、退信和收件箱投递经验
快速参考
| 主题 | 文件 | 用途 |
|---|
| 设置和首次运行防护 | setup.md | 初始化~/smtp/,不存储密钥或过早发送邮件 |
| 记忆结构 |
memory-template.md | 创建包含状态和稳定上下文的~/smtp/memory.md |
| 基线记忆示例 | memory.md | 展示实时SMTP记忆文件的预期格式 |
| 提供商配置文件基线 | provider-profiles.md | 跟踪已批准的提供商、端口、认证模式和发件人身份 |
| 发送决策日志基线 | send-log.md | 记录预演、金丝雀、队列ID和验证证据 |
| 可投递性说明基线 | deliverability-notes.md | 捕获DNS认证状态、垃圾邮件文件夹证据和退信模式 |
| 安全执行工作流 | send-flow.md | 执行草稿 -> 预检 -> 金丝雀 -> 验证 -> 扩展 |
| 故障隔离指南 | diagnostic-playbook.md | 区分DNS、TLS、认证、中继和投递故障 |
| 可投递性规则 | deliverability.md | 检查SPF、DKIM、DMARC、对齐和收件箱投递 |
| CLI探测模式 | swaks-recipes.md | 使用仅含占位符的示例进行确定性SMTP测试 |
要求
- - 仅当用户需要进行真实网络测试或实时发送时,才使用SMTP主机访问。
- 凭证必须在运行时来自用户批准的密钥源,绝不能来自~/smtp/下的文件。
- 推荐工具:swaks用于SMTP探测,openssl用于TLS检查,dig或nslookup用于DNS检查。
- 任何实时发送、外部收件人测试或多收件人操作前,需获得明确确认。
核心规则
1. 区分草稿、探测和实时发送
- - 在接触网络前确定任务模式:仅草稿、连接探测、认证探测、金丝雀发送或实时发送。
- 先起草和解释。不要从帮我配置SMTP直接跳到消息已发送。
2. 精确匹配端口、TLS和认证
- - 端口465表示隐式TLS。端口587通常表示STARTTLS。端口25是中继传输,通常被阻止或受策略限制。
- 将主机、端口、TLS模式和认证机制视为一个整体。单个不匹配可能表现为通用超时或认证错误。
3. 逐层调试
- - 按顺序验证:DNS和主机名、TCP可达性、TLS握手、EHLO能力、认证、提交响应,然后是邮箱投递。
- 在证明连接和认证层正常之前,不要调整可投递性记录。
4. 保持发件人身份一致
- - 检查认证账户、信封发件人、可见的发件人地址、DKIM域名和返回路径域名是否真正匹配。
- 不一致通常会导致550/553拒绝、被归入垃圾邮件,或发送成功但收件箱无结果。
5. 先金丝雀后扩展
- - 首次实时测试应针对一个已批准的金丝雀收件人,最好在同一组织或受控收件箱内。
- 只有在获得队列接受、消息ID证据和收件箱或垃圾邮件确认后,才能扩大收件人范围。
6. 安全处理凭证和日志
- - 切勿将原始SMTP密码、API令牌或完整密钥写入~/smtp/。
- 在存储或共享前,对日志和截图进行脱敏处理。只保留调试所需的最小证据。
7. 接受不等于投递
- - 250 queued或类似的服务器响应表示SMTP服务器已接受消息,而非收件人收件箱已接受。
- 始终通过退信证据、邮箱投递或下游提供商日志(如可用)验证最终状态。
常见陷阱
| 陷阱 | 失败原因 | 更好的做法 |
|---|
| 将端口465和587视为可互换 | TLS握手中断或认证无法启动 | 明确区分隐式TLS和STARTTLS |
| 在修复认证前修改SPF |
层次错误,对登录失败无效 | 分别验证DNS、TLS和认证 |
| 认为250表示收件箱成功 | 队列接受不等于邮箱投递 | 检查垃圾邮件、退信和最终收件人证据 |
| 使用外部收件人作为首次测试 | 增加影响范围和风险 | 从一个已批准的金丝雀收件箱开始 |
| 禁用证书检查以使其工作 | 隐藏真实的TLS或主机名问题 | 改为修复主机名、CA信任或端口选择 |
| 让发件人地址与认证身份严重不符 | 触发中继拒绝或垃圾邮件评分 | 对齐发件人身份或记录中继策略 |
外部端点
| 端点 | 发送的数据 | 目的 |
|---|
| 配置的SMTP提交服务器,如smtp.example.com | 仅针对已批准的实时测试或发送的消息头、收件人、正文和附件 | 提交或测试出站邮件 |
| 发件人域的DNS解析器或权威名称服务器 |
域名和记录查询,用于SPF、DKIM、DMARC、MX和PTR检查 | 诊断可投递性和域对齐 |
除非用户明确批准更广泛的工具使用,否则不应向外部发送其他数据。
数据存储
~/smtp/中的本地状态包括:
- - memory.md中的激活状态、已批准的提供商和安全默认值
- provider-profiles.md中的已知良好服务器配置文件和发件人身份说明
- send-log.md中的预演决策、金丝雀证据和消息ID
- deliverability-notes.md中的域认证和投递发现
安全与隐私
离开您机器的数据:
- - 仅在已批准的探测或实时发送期间的SMTP信封和消息内容
- 验证发件人域健康和路由所需的DNS查询
保留在本地的数据:
- - ~/smtp/memory.md中的安全默认值和已批准的提供商上下文
- ~/smtp/provider-profiles.md、~/smtp/send-log.md和~/smtp/deliverability-notes.md中的已知良好提供商设置和调试证据
此技能不会:
- - 未经明确确认发送实时邮件
- 在本地记忆中存储原始SMTP密码或令牌
- 修改DNS记录、邮件列表或提供商设置,除非用户明确要求
- 静默禁用TLS验证
- 修改自身的技能定义
信任
使用此技能,已批准的消息内容将发送到配置的SMTP提供商和相关DNS基础设施。
仅当您信任这些提供商处理您的出站邮件流时,才安装和运行它。
范围
此技能仅:
- - 帮助配置和诊断出站SMTP提交
- 在~/smtp/中维护小型本地笔记
- 运行金丝雀优先的发送工作流,并带有明确的确认关卡
此技能绝不:
- - 从模糊的用户意图猜测实时发送批准
- 在~/smtp/中保留凭证
- 将队列接受视为最终投递结果
- 未经同意将一次性测试扩展为批量发送工作流
相关技能
如果用户确认,使用clawhub install
安装:
- - mail - 跨IMAP、SMTP和Apple Mail工作流的更广泛邮箱操作
- dns - 针对SPF、DKIM、DMARC、MX和TTL更改的更深入DNS记录工作
- network - 超出邮件工作流的端口可达性、TLS和连接调试
- newsletter - SMTP投递正常后的消息设计和活动结构
- email-marketing - 发送路径稳定后的可投递