Mailbox

io.github.psyb0t由 GitHub 账号 psyb0t 发布v0.8.0更新于 Oct 30, 2026

Scoped IMAP/SMTP access over HTTP and MCP: read, organize, draft, reply and send mail.

发布方自己的服务:mailbox.bot

已验证STDIO仅桌面沟通与协作安全与监控

概览

AI 生成的概览

自托管的 IMAP/SMTP 邮件网关,提供 MCP 端点,让助手在受限令牌下读取、整理、起草、回复和发送邮件。

可以做什么
  • 读取邮件:统一收件箱、结构化搜索、原始源码、邮件头、附件与会话线程
  • 整理邮箱:已读标记、标签、移动、创建邮箱以及移入废件箱
  • 起草与发送:已配置身份、签名、回复、IMAP 草稿与已发送副本
  • 分析邮件:SPF/DKIM/DMARC 判定、邮件头不一致、隐藏文本与欺骗性链接,可按需返回净化后的 HTML
  • 运维控制:按令牌的作用域与邮箱白名单、审计记录、共享发送限额与签名 webhook
适用场景
适合希望助手直接操作自有 IMAP/SMTP 账户中的真实邮箱,同时把发送和删除限制在明确的令牌作用域、演练模式与速率限制之后。适用于自托管场景:邮件正文留在邮件服务器上,本地只保存运行状态。
运行要求
以本地 Docker 容器运行(镜像 psyb0t/mailbox),在同一端口提供 HTTP 与 MCP 端点。需要 config.yaml 配置 IMAP/SMTP 账户与身份,以及存放账户密码和 bearer 令牌的 .env;README 建议将两个文件权限设为 chmod 600。挂载 /var/lib/mailboxd 卷以保留状态。清单本身未声明任何凭据。
安装前请注意
容器在配置与环境文件中保存邮件账户密码和 bearer 令牌,需妥善保护并避免纳入版本控制。令牌可授予读取、起草、整理、发送或删除作用域;具备 send 的令牌能真正发出邮件,永久删除需要 delete 作用域。所有写入与被拒绝的写入都会记入审计日志;可选的 watcher 会保持 IMAP 长连接,并可能向外部端点投递 webhook。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mailbox,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mailbox

[CI] [version] [license] [Docker Pulls]

Read, organize, draft and send mail across multiple IMAP/SMTP accounts through one HTTP API and an MCP endpoint at /mcp, on the same port. Each bearer token controls which operations and mailboxes a client can access.

For agent access, configure tokens with explicit permissions:

  • Scoped tokens. A token that holds read, draft and organize cannot send or delete, and does not even see those tools.
  • Deletion defaults to Trash. Deleting moves a message to Trash. Permanent erasure needs the delete scope and only works from the Trash folder. The service never issues a folder-wide EXPUNGE.
  • Drafts in two steps. An agent can prepare a reply; a human (or a token with send) sends it.
  • Send guard. Hourly rate limit, dry-run mode, and a sender address authorized by your configured exact identities or opt-in domain patterns.
  • Message analysis. Inspect SPF/DKIM/DMARC verdicts, header mismatches, hidden text and deceptive links. Verdicts are trusted only when the receiving server matches your configuration. Request sanitized HTML when needed.
  • Audit log. Every write, and every refused write, is recorded (never message bodies).

Mail bodies and drafts stay on IMAP. A shared SQLite database stores audit records, send counters, checkpoints, draft send claims and webhook delivery metadata. API requests close their mail-server connections after use; the watcher keeps an IMAP connection open for notifications.

The service uses Python's imaplib and smtplib, FastAPI, the official MCP Python SDK and nh3 for HTML sanitizing. Dependency updates enforce a seven-day release-age cutoff through uv's exclude-newer setting.

Contents

Quick start

  1. Copy config.example.yaml to config.yaml and .env.example to .env. Configure your accounts and replace every placeholder in .env with its password or a fresh token from openssl rand -hex 32. Restrict both files with chmod 600.
  2. Start the container. The named volume preserves operational state across restarts:
bash
docker run --rm \  -p 127.0.0.1:8000:8000 \  --env-file .env \  -v "$PWD/config.yaml:/etc/mailboxd/config.yaml:ro" \  -v mailboxd-state:/var/lib/mailboxd \  psyb0t/mailbox:latest
  1. Check health and list mail:
bash
TOKEN="paste-the-token-here"
curl -s http://localhost:8000/health | jq                                               # health is always opencurl -s -H "Authorization: Bearer $TOKEN" http://localhost:8000/mailboxes | jqcurl -s -H "Authorization: Bearer $TOKEN" 'http://localhost:8000/inbox?limit=5' | jq

Docker Compose

The checked-in docker-compose.yml publishes on 127.0.0.1:${PORT:-8000}, mounts ./config.yaml (or $MAILBOXD_CONFIG) read-only and creates the mailboxd-state volume:

yaml
services:  mailboxd:    image: psyb0t/mailbox:latest    ports: ["127.0.0.1:8000:8000"]    volumes:      # Keep config.yaml out of Git and restrict access to its credentials.      - ./config.yaml:/etc/mailboxd/config.yaml:ro      - mailboxd-state:/var/lib/mailboxdvolumes:  mailboxd-state:

The optional webhook watcher is a second service in the same file, off by default: docker compose --profile watch up -d.

Capabilities

AreaOperations
ReadingUnified inbox, structured search, raw source, headers, attachments and threads
OrganizationSeen flags, labels, move, mailbox creation and Trash
SendingConfigured identities, signatures, replies, IMAP drafts and Sent copies
AccessPer-token scopes and mailbox allowlists shared by REST and MCP
OperationsSQLite audit records, shared send limits, checkpoints and durable signed webhooks

Mount /var/lib/mailboxd for persistent operational state. HTTP workers and the optional watcher share one SQLite database on a local filesystem. Read the migration notes before replacing a stateless deployment.

Development

bash
make lint           # flake8 and mypymake test-coverage  # full suite, production container and coverage floormake audit          # frozen runtime and dev dependency advisoriesmake build          # production imagemake help           # all available targets

All project tools run inside the development image. Tests use socket-level IMAP/SMTP fixtures, a local HTTP receiver, real SQLite files and a production-container smoke test. See development for details.

License

WTFPL. See LICENSE and third-party components.

来源:README.md,提交 33a2eb1

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:该软件包类型无法在沙箱中运行。

版本历史

8
  1. v0.8.0最新Oct 29, 2026
  2. v0.7.0Oct 23, 2026
  3. v0.6.2Oct 21, 2026
  4. v0.6.1Oct 19, 2026
  5. v0.6.0Oct 19, 2026
  6. v0.5.1Oct 13, 2026
  7. v0.4.16Oct 10, 2026
  8. v0.4.15Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Mailbox 集成