
ownmail
io.github.ownlabs-dev/ownmail
One mailbox on your own OwnMail mail server: search, read, organise, send and reply to mail.
Documentation
OwnMail
Your own mail server in one Go program — with mailboxes AI agents can use.

OwnMail receives, filters, stores and sends mail for your own domains, and syncs calendars and contacts, on one server you run yourself. It is one program with a web interface for administrators and one for the people with a mailbox.
Why OwnMail
- One program instead of a stack. No Postfix, Dovecot, Rspamd and glue to keep in sync: SMTP, IMAP, filters, spam checks, signing, calendars and contacts run in a single process. The release binary is about 33 MB; on a small test setup (3 domains, 7 mailboxes) it used around 175 MB of memory.
- DNS you can get right. Every domain lists each record it needs, checked live (in place, missing or different), with copy buttons, and copies all of them at once as a zone file or as step-by-step instructions for an AI assistant. OwnMail never changes your DNS itself.
- Built for AI agents. Each mailbox has its own MCP endpoint: an agent can search, read, sort and send mail within the person's rights. A second MCP endpoint manages the whole server with access tokens or by signing in from claude.ai or ChatGPT.
- Safe to run. Two-factor sign-in for administrators and mailboxes, administrators for single domains, encrypted incremental backups to a Storage Box, SFTP, S3-compatible storage or a folder, with restoring of single mailboxes, and updates on a click that go back to the old version if the new one does not start (with the update container of the compose file, or a deploy hook).
- Groupware included. Calendars and contacts (CalDAV/CardDAV) that sync to phones and computers, filters, out-of-office replies, shared mailboxes, rooms and equipment, and forwarding and distribution groups.
- Easy for mail programs. Thunderbird and Outlook find their settings
from the address, Apple devices get a setup file, and each domain can
have its own server name for mail programs (
mail.your-domain.com). - You see what happens. The start page shows what stands between your server and good delivery and how much mail came in, went out and was turned away. Administrators get a mail when the certificate is about to expire, the disk is nearly full, a backup fails, a mailbox is stopped from sending or a domain's DNS records are wrong.
What it does not do (yet)
- No webmail, and no calendar or contacts in the browser: use any IMAP and CalDAV/CardDAV program, such as Thunderbird, Apple Mail and Calendar, Outlook (over IMAP), or DAVx⁵ on Android. Planned: webmail #13, calendar #31, contacts #32.
- No Exchange/ActiveSync (#34).
- No virus scanning, no reports from receivers about your mail, no MTA-STS or DANE for outgoing mail (docs/Usage.md).
Quick start
You need:
- a server where port 25 is open in both directions: many cloud hosters block outgoing port 25 and unblock it only on request;
- the reverse DNS (PTR) of the server's address set to the mail server's name, at your hoster;
- a domain you control, to point the mail server's name and the mail records at the server;
- Docker with the Compose plugin (or systemd).
docs/Docker.md explains each of these and how to test them. Then:
-
Point
mail.example.comat the server (Arecord) and fetch the compose file:mkdir ownmail && cd ownmail curl -fsSLO https://raw.githubusercontent.com/ownlabs-dev/ownmail/main/docker-compose.yml printf 'OWNMAIL_HOSTNAME=mail.example.com\nOWNMAIL_ACME_EMAIL=you@example.com\n' > .env -
Start it and read the one-time setup code from the log:
docker compose up -d docker compose logs ownmail | grep setup_code -
Open
https://mail.example.com/admin, create the first administrator with the code, add your domain and enter the DNS records it shows.
Other ways to run it: systemd,
Coolify, or the image ghcr.io/ownlabs-dev/ownmail
behind your own reverse proxy.
All flags and paths: docs/Reference.md.
Screenshots
![]() | ![]() |
| The start page: what needs attention and the mail traffic | A mailbox in the administration |
![]() | ![]() |
| The mailbox owner's own page | Dark theme |
AI programs (MCP)
OwnMail speaks the Model Context Protocol in two places:
https://<mail server>/mcp, per mailbox: an AI program (Claude Code, Cursor, claude.ai, ChatGPT, …) can list folders, search and read messages and attachments, flag, move and delete them, save drafts, set the out-of-office reply, and send, reply and forward, with the same rights and sending limits as the person. Connect it with an app password or by signing in and choosing what it may do (read, organise, send).https://<mail server>/api/mcp, for administrators: manage domains, DNS records, mailboxes, forwarding, settings and backups with an access token that can be limited to reading, or by signing in from programs that connect by address only. It never reads mail.
claude mcp add --transport http mail https://mail.example.com/mcp \
--header "Authorization: Bearer <app password>"
Details: docs/MCP.md for the administration, docs/Usage.md for mailboxes.
OwnMail is in the official
MCP Registry
(io.github.ownlabs-dev/ownmail for a mailbox, io.github.ownlabs-dev/ownmail-admin
for the administration), so programs that read it can set OwnMail up with
just your mail server's name.
OwnMail is also listed on Glama, a directory of MCP servers: there you can browse its tools and see its quality score before installing it.
Documentation
All of it is also in the wiki.
- Usage: domains and DNS records, mailboxes, forwarding, sharing, filters, mail programs, AI programs, administrators.
- Docker, systemd, Coolify: running OwnMail.
- Reference: commands, flags and paths.
- Backups, Updates, Releases.
- MCP: the administration for AI programs and scripts.
- Groupware and Architecture: how it is built and why.
The full index is docs/README.md.
Status
OwnMail is stable since 1.0: your data, the configuration and the administration API stay compatible within a major version, and every update from the previous release is tested before it is published (see What 1.0 promises). The newest release says what changed. Release versions are computed from Conventional Commits. Read the release notes before you update, and keep backups.
Contributing
Issues and pull requests are welcome; for bigger changes please open an issue first. How to build, test and run it locally: CONTRIBUTING.md. The rules of the codebase are in AGENTS.md.
Security
Please report vulnerabilities privately as described in SECURITY.md, never in a public issue.
License
No installation packages available.



