Self-hosted email for AI agents and automations. Your inboxes, your infrastructure, your control.
Mammoth Mail brings email into one self-hosted platform for AI agents, automations, and applications. Create inboxes on your own domains or connect existing Gmail, Outlook, and IMAP mailboxes, all through a single web interface and API.
Give agents and automations scoped access to read, search, draft, and send email, with optional human approval before messages go out.
Deploy in a single Docker container, bring your own email providers, and integrate with Hermes, OpenClaw, webhooks, or the REST API.
Quickstart · Receiving providers · Agent connectors · Documentation
Public beta · Open source · Self-hosted
Run a complete email platform in a single self-hosted container, with a built-in web interface and no complicated mail server stack.
Create inboxes on your own domain or connect existing mailboxes. Choose from a wide range of receiving and sending providers, or run your own.
One platform for email, whether it's for AI agents, automations, applications, or everyday use.
Create an assistant API key that lets agents read messages, search email, and prepare drafts without permission to send directly.
Keep sending subject to your approval, or give trusted agents direct sending permissions.
Choose how you review and send agent-generated emails:
- Drafts folder: Agents place drafts in your mailbox, ready for you to review, edit, and send.
- Email approval: Receive an approval request by email. Approve or reject, and Mammoth Mail automatically sends approved messages.
Tusk MX receives email for your domain and forwards it to Mammoth Mail without opening inbound SMTP ports.
Simply configure your DNS records and start receiving. Or use your own MX receiver or third-party provider.
Mammoth Mail supports multiple receiving methods, giving you the flexibility to use existing infrastructure or start from scratch.
| Receiving option | Best for |
|---|---|
| Tusk MX | Receive email for your own domain without opening inbound SMTP ports |
| Mailgun, Cloudflare Email Routing, Resend, Postmark | Connect existing inbound email providers |
| Direct MX | Receive email directly into Mammoth Mail over SMTP |
| Remote MX / Dial MX | Run your own separate or shared receiving server |
| Gmail, Outlook, IMAP | Connect existing mailboxes without moving your email |
For outbound email, bring your own Mailgun, Brevo, Resend, SMTP relay, or direct sending configuration.
See the email providers guide.
Run Mammoth Mail with one Docker Compose file. No repository checkout or separate .env file required.
1. Create docker-compose.yml:
services:
mammothmail:
image: ghcr.io/dellarb/mammothmail:latest
restart: unless-stopped
environment:
ADMIN_EMAIL: "admin@example.com"
ADMIN_PASSWORD: "replace-with-a-strong-password"
# Optional but strongly recommended: run `openssl rand -hex 32`
# and uncomment the next line, pasting the generated key.
# APP_ENCRYPTION_KEY: "paste-generated-key-here"
#Optional but strongly recommended to configure a proper URL behind reverse proxy.
#Many sender settings depend on this value - it must be real URL you use to access mammothmail.
#BASE_URL: "https://mail.example.com"
volumes:
- ./data:/data
ports:
- "8081:8081"Set your administrator credentials and change BASE_URL to the address you'll use. For local-only testing without a reverse proxy, use http://localhost:8081.
APP_ENCRYPTION_KEY is optional: when omitted, Mammoth Mail creates one automatically at ./data/encryption_key. If you supply a key, back it up separately from ./data and keep it unchanged after connecting providers. Whichever key is in use must be retained to decrypt saved provider credentials.
2. Start Mammoth Mail:
docker compose up -dOpen your configured URL and sign in. Add your domain or connect an existing mailbox, configure receiving and sending, create inboxes, and connect your agent.
For external access, place Mammoth Mail behind an HTTPS reverse proxy. Direct SMTP receiving requires an additional port mapping (25:2525) and setup in UI. See the self-hosting guide.
Mammoth Mail works with AI agents, automations, and applications through multiple integration methods.
- Hermes Relay: Connect Hermes agents through an authenticated, outbound WebSocket connection. Receive events in real time without exposing the agent to the internet.
- OpenClaw: Connect OpenClaw using the included relay-based channel plugin.
- Webhooks: Deliver incoming messages and mailbox events to your own service.
- REST API: Read messages, search history, manage drafts, request approvals, and send email with appropriate permissions.
Give your agent a Mammoth Mail URL and API key. Mammoth Mail provides built-in discovery, setup instructions, permission information, and a machine-readable API.
/.well-known/mail-api Agent discovery
/agent Agent setup guide
/v1/bootstrap API key permissions
/openapi.json OpenAPI specification
See the agent connector guide.
Domain and connected inboxes share the same native message schema and mailbox
API. Follow next_cursor with before for lists, threads and search; inspect
the inbox's folder and label capabilities and its authoring settings rather
than branching on inbox type. A message's location is its folder_id and its
labels are the additive label_ids; a folder is never a label. See the
API capability matrix
for deliberate provider limits, including remote body availability and deletion.
| Guide | Covers |
|---|---|
| Email providers | Inbound, outbound and standalone mailbox configuration |
| Agent connectors | Hermes, OpenClaw, webhooks and API integration |
| Self-hosting | Deployment, TLS, backups, security and upgrades |
| Remote MX | Tusk MX, Dial MX and separate receivers |
| API | Endpoints, permissions, drafts and events |
| Decisions | Architecture decisions and their rationale (maintainers) |
Mammoth Mail is open source. Contributions, bug reports and documentation improvements are welcome.
See CONTRIBUTING.md for contribution guidelines and SECURITY.md for reporting vulnerabilities.
Mammoth Mail is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).