# Mailbox

Connects an agent to mail accounts over IMAP and SMTP: read, file away, prepare drafts, send. Permissions are tied to bearer tokens.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 5
- Author: psyb0t
- License: WTFPL · policy=link-only · description only; the file stays with the author
- Source: https://github.com/psyb0t/docker-mailbox
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/mcp/mailbox

## What it does

The service runs in Docker and serves an HTTP API plus an MCP endpoint at `/mcp` on one port. Several accounts can sit behind it, each described in `config.yaml`. Message bodies and drafts never leave IMAP. A local SQLite file holds operational records only: audit entries, send counters, checkpoints and webhook delivery metadata.

Tokens decide what the agent can do. Give a token `read`, `draft` and `organize` and it will not even see send or delete tools. A delete moves the message to Trash; wiping it for good requires the `delete` scope and works only inside Trash, and the service never runs a folder-wide `EXPUNGE`. Drafts are a two-step affair: the agent writes one, a person or a token holding `send` releases it. Sending also passes an hourly rate limit, an optional dry-run and a check that the sender address matches a configured identity.

Before the first start you need `config.yaml` and `.env`. Put passwords or freshly generated tokens from `openssl rand -hex 32` there, then run `chmod 600` on both files and mount the config read-only. Mount a volume at `/var/lib/mailboxd` too, otherwise audit records and counters vanish on restart. The stack is Python: `imaplib`, `smtplib`, FastAPI, the official MCP Python SDK and `nh3` for sanitizing HTML.

## Requirements
- Needs: Docker
- Works with: Docker

## Install

### Claude Code (native platform)

**Install**
- The MCP registry has no launch command for it: see the repository README

## When to use it
- pull the latest messages from a shared inbox into an agent
- file incoming mail into folders and labels
- prepare a reply draft for a colleague to approve
- send mail from a verified sender within a rate limit
- inspect SPF, DKIM and DMARC verdicts on a suspicious message

## Example prompts
- Show me the five newest inbox messages and summarize them.
- Find this week's mail from the finance team and move it to the `finance` folder.
- Draft a reply to the latest client message, don't send it yet.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 392262
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119231
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47577
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43902

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
