Fork of Mailpit adding Postmark API emulation and an MCP server for AI-assisted debugging.
Inspired by and grateful to the original work on Mailpit and MailHog. See Credits.
Repository β’ Installation β’ Usage β’ Postmark API β’ MCP Server
MailSandbox is a small, fast, low-memory, zero-dependency, multi-platform email testing tool & API for developers.
It provides an SMTP server, modern web interface, REST API, Postmark API emulation, and an MCP server for AI-powered workflows.
- π Lightweight β single static binary or multi-arch Docker image
- π Modern Web UI β view HTML, source, headers, attachments, search & filter
- π¬ SMTP & POP3 servers β STARTTLS/SSL/TLS, authentication, forwarding, relaying
- π Testing tools β HTML check, link check, spam score, screenshots, mobile preview
- π· Tagging & filtering β manual or automated (incl. plus addressing)
- β‘ Performance β 100β200 emails/sec, automatic pruning (default 500 emails)
- π§ͺ Chaos mode β inject SMTP errors to test resilience
- π Integrations β webhooks, browser notifications,
List-Unsubscribevalidation - π Postmark API emulation β drop-in replacement for Postmark during development
- π€ MCP server β AI assistants (e.g., Claude Code) can list, search, and analyze messages
The web UI runs on http://0.0.0.0:8025 and SMTP on 0.0.0.0:1025.
sudo sh < <(curl -sL https://raw.githubusercontent.com/btafoya/mailsandbox/main/install.sh)Download from releases, rename to mailsandbox, and add to $PATH.
docker run -d --name mailsandbox -p 8025:8025 -p 1025:1025 btafoya/mailsandboxList options:
mailsandbox -hEnable Postmark API emulation:
mailsandbox --postmark-api --postmark-token "your-secret-token"Environment variables:
export MP_POSTMARK_API=true
export MP_POSTMARK_TOKEN=your-secret-token
mailsandboxExample: Node.js
const postmark = require("postmark");
const client = new postmark.ServerClient("your-secret-token");
client.apiUrl = "http://localhost:8025";
client.sendEmail({ From:"a@x.com", To:"b@y.com", Subject:"Test", TextBody:"Hello" });Endpoints:
POST /emailPOST /email/batchPOST /email/withTemplate
Enable MCP server:
mailsandbox --mcp-server --mcp-transport stdioEnvironment variables:
export MP_MCP_SERVER=true
export MP_MCP_TRANSPORT=stdiodocker build -t mailsandbox-with-mcp .
docker run -d --name mailsandbox -p 127.0.0.1:8025:8025 -p 1025:1025 -e MP_MCP_SERVER=true -e MP_MCP_TRANSPORT=stdio -e MP_POSTMARK_API=true -e MP_POSTMARK_TOKEN=dev-token-123 mailsandbox-with-mcplist_messagesβ list/filter emailsget_messageβ retrieve full messagesearch_messagesβ advanced searchanalyze_messageβ HTML, links, spam scoring
- Binary name renamed
mailsandbox; create a symlink if you prefermailpit. - Default ports unchanged: HTTP
8025, SMTP1025. - APIs: REST API unchanged; Postmark & MCP are opt-in.
- Docker: use forked image for MCP/Postmark features.
- Mailpit β by Axel Lenferna de la Motte and contributors. Original project and active development.
- MailHog β the original inspiration for mainer email testing tools.
- MailSandbox β maintained by Brian Tafoya, adding Postmark API emulation and MCP server support.
MailSandbox inherits the upstream license from Mailpit. See LICENSE for details.