Skip to main content
Glama
OwnMail

OwnMail

Official
by ownlabs-dev

OwnMail

Your own mail server in one Go program — with mailboxes AI agents can use.

Latest release CI License: AGPL-3.0 Container image

A domain's DNS records, each with its check result and copy buttons, and buttons to copy all of them as a zone file or for an AI assistant

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.

  • 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.

Related MCP server: email-mcp

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:

  1. Point mail.example.com at the server (A record) 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
  2. Start it and read the one-time setup code from the log:

    docker compose up -d
    docker compose logs ownmail | grep setup_code
  3. 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 administration's start page: what needs attention, domains, mailboxes, backups and the mail traffic of the last 24 hours

A mailbox in the administration: storage, sending limits, devices and app passwords

The start page: what needs attention and the mail traffic

A mailbox in the administration

The mailbox owner's own page: settings for mail programs, calendars and contacts

The administration's start page in the dark theme

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. 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.

Documentation

The full index is docs/README.md.

Status

OwnMail is a young project (current release v0.4.0) and changes quickly. Release versions are computed from Conventional Commits, see docs/Releases.md. 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

AGPL-3.0.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Multi-account IMAP/SMTP email MCP server with 22 tools — read, send, search, organize, thread, attachments, and batch operations. Features connection pooling, rate limiting, retry with backoff, and OAuth2 device-code flow. Written in Go.
      4
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Local MCP server for multi-account IMAP/SMTP email (iCloud + Gmail via app-specific passwords). Never marks mail read. Cross-folder search, idempotent sends, TLS verified.
      8
      MIT
    • A
      license
      C
      quality
      A
      maintenance
      Full-stack email MCP server in Rust: IMAP, SMTP, Exchange Web Services, and Microsoft Graph in one binary, with OAuth2 and multi-account support. Read, search, send, reply, forward, bulk operations, and attachment download to disk.
      37
      124
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      A self-hosted remote MCP server that gives AI assistants read, organize and optional send access to mail, calendars, tasks and contacts across many IMAP, Gmail, CalDAV, CardDAV and Google accounts behind one authenticated endpoint.
      2
      Apache 2.0