当前位置: 首页 > Skill >

SMTP

SMTP

1.0.0 2026.11.24 浏览:170
获取Skill文件查看使用说明
作者:陆安许可证:
本文目录展开

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.

~/smtp/
├── memory.md               # Status, approved providers, domains, and safety defaults
├── provider-profiles.md    # Known-good hosts, ports, auth mode, and sender identity notes
├── send-log.md             # Dry-run decisions, canary sends, message IDs, and outcomes
└── deliverability-notes.md # SPF, DKIM, DMARC, bounce, and inbox-placement learnings

Quick Reference

Topic File Use it for
Setup and first-run guardrails setup.md 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 smtp.example.com 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 memory.md
  • known-good server profiles and sender-identity notes in provider-profiles.md
  • dry-run decisions, canary evidence, and message IDs in send-log.md
  • domain-auth and placement findings in deliverability-notes.md

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 ~/smtp/memory.md
  • known-good provider settings and debugging evidence in ~/smtp/provider-profiles.md, ~/smtp/send-log.md, and ~/smtp/deliverability-notes.md

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 ~/smtp/
  • runs canary-first send workflows with explicit confirmation gates

This skill NEVER:

  • guess live-send approval from vague user intent
  • keep credentials in ~/smtp/
  • 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
  • dns - deeper DNS record work for SPF, DKIM, DMARC, MX, and TTL changes
  • network - port reachability, TLS, and connection debugging beyond mail workflows
  • newsletter - message design and campaign structure once SMTP delivery is healthy
  • email-marketing - deliverability and audience strategy after the send path is stable

Feedback

  • If useful: clawhub star smtp
  • Stay updated: clawhub sync

相关文章

更多
PHP使用PHPMailer通过SMTP发送邮件完整教程

安装 PHPMailer 后,配置 SMTP 参数并调用 send() 即可发送。需确保服务器网络允许连接邮件服务商端口。

2026.08.17 885
PHP邮件发送失败排查:SMTP连接超时与认证错误解决

排查 PHP 邮件发送失败,优先检查 SMTP 连接超时与认证错误。若使用 PHPMailer ,确保配置了正确的 Host 、 Port 、 Username 和 Password ,并开启 SMTPDebug 查看具体报错。

2026.05.02 643
PHP发送邮件被识别为垃圾邮件?Header设置与SPF配置建议

要让 PHP 发出的邮件不被标记为垃圾邮件,核心在于 mail() 函数的 $additional_headers 参数中必须正确设置 From 、 Reply-To 和 X-Mailer ,同时确保服务器 IP 已通过 SPF 记录验证。如果缺少这些头部信息或域名未配置 DNS 解析,邮件极易被拦截。

2026.02.10 620
PHPMailer集成QQ邮箱发送订单通知代码示例

本文介绍利用PHPMailer库结合QQ邮箱SMTP服务实现PHP邮件发送功能的具体方案。通过实例代码展示如何引入核心类、配置发件人及认证信息,并封装sendMail函数处理订单通知场景。该方案适用于开发环境调试及生产环境部署,帮助开发者快速集成邮件提醒机制。

2026.03.03 512
PHP配置QQ邮箱和Gmail SMTP服务发送邮件的步骤

使用 PHPMailer 库,配置 SMTP 服务器地址、端口、加密方式及授权码即可实现邮件发送。

2026.03.06 265
Skill 文件
  • SKILL.md
    • When to Use
    • Architecture
    • Quick Reference
    • Requirements
    • Core Rules
      • 1. Separate Draft, Probe, and Live Send
      • 2. Match Port, TLS, and Auth Exactly
      • 3. Debug One Layer at a Time
      • 4. Keep Sender Identity Aligned
      • 5. Canary Before Scale
      • 6. Handle Credentials and Logs Safely
      • 7. Acceptance Is Not Delivery
    • Common Traps
    • External Endpoints
    • Data Storage
    • Security & Privacy
    • Trust
    • Scope
    • Related Skills
    • Feedback
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期