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 整合