← 返回
沟通协作 Key 中文

Send email using MailChannels Email API

Send email via MailChannels Email API and ingest signed delivery-event webhooks into Clawdbot (Moltbot).
通过 MailChannels Email API 发送邮件,并将已签名的投递事件 Webhook 接收至 Clawdbot (Moltbot)。
ttulttul
沟通协作 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 1
Stars
📥 2,463
下载
💾 91
安装
1
版本
#latest

概述

MailChannels Email API (Send + Delivery Events)

Environment

Required:

  • MAILCHANNELS_API_KEY (send in X-Api-Key)
  • MAILCHANNELS_ACCOUNT_ID (aka customer_handle)

Optional:

  • MAILCHANNELS_BASE_URL (default: https://api.mailchannels.net/tx/v1), MAILCHANNELS_WEBHOOK_ENDPOINT_URL

Domain Lockdown (DNS)

Create a TXT record for each sender domain:

  • Host: _mailchannels.
  • Value: v=mc1; auid=

API Quick Reference

Base URL: ${MAILCHANNELS_BASE_URL:-https://api.mailchannels.net/tx/v1}

  • Send: POST /send
  • Send async: POST /send-async
  • Webhook: POST /webhook?endpoint=, GET /webhook, DELETE /webhook, POST /webhook/validate
  • Public key: GET /webhook/public-key?id=

Sending Email

Minimum payload fields: personalizations, from, subject, content.

Use /send for normal traffic and /send-async for queued/low-latency; both produce webhooks.

Persist MailChannels correlation IDs (e.g., request_id).

Delivery Events (Webhooks)

MailChannels POSTs a JSON array. Common fields: email, customer_handle, timestamp, event, request_id.

Bounce fields often include: recipients, status, reason, smtp_id.

Moltbot Hooks Routing

1) Enable hooks in ~/.clawdbot/moltbot.json.

2) Map /hooks/ to an agent action via hooks.mappings and optional transform.

3) Enroll the public endpoint in MailChannels /webhook?endpoint=....

Webhook Signature Verification

Headers: Content-Digest, Signature-Input, Signature.

Steps:

  • Parse Signature-Input (name, created, alg, keyid).
  • Reject stale created values.
  • Fetch public key by keyid.
  • Recreate the RFC 9421 signature base.
  • Verify ed25519 signature (avoid hand-rolling).

Also verify JSON body is an array and every event has customer_handle == MAILCHANNELS_ACCOUNT_ID.

Correlation + State Updates

Store your internal message ID + MailChannels IDs (e.g., request_id, smtp_id).

Update delivery state from events: processed, delivered, soft-bounced, hard-bounced, dropped.

Operational tips: respond 2xx quickly, process async, store raw events, dedupe retries.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-28 14:18 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

communication-collaboration

Gmail

byungkyu
Gmail API 集成,托管 OAuth,支持读取、发送和管理邮件、线程、标签及草稿,适用于需要与 Gmail 交互的场景。
★ 72 📥 37,731
communication-collaboration

Slack

steipete
当需要通过 slack 工具从 Clawdbot 控制 Slack 时使用,包括在频道或私信中回复消息或置顶/取消置顶项目。
★ 157 📥 47,680
communication-collaboration

Himalaya

lamelas
{"answer":"通过IMAP/SMTP管理邮件的CLI。可在终端使用 `himalaya` 收发、回复、转发、搜索及整理邮件。支持多账户与MML(MIME元语言)编写邮件。"}
★ 68 📥 45,587