mailcow + AI

Connect mailcow to Claude,
and Cursor, ChatGPT, any MCP client

mailcow already gives you Dovecot, Postfix and SOGo in one stack. Add an MCP server on top and your agent can read, search, send, reply, schedule and file mail in the mailboxes you host yourself.

Claude cannot reach a mailcow server on its own. mcpemails is a hosted MCP server that connects to your mailcow install over IMAP on port 993, at the hostname you set as MAILCOW_HOSTNAME in mailcow.conf, using the mailbox password from the Mailboxes list, so Claude, Cursor or any MCP client can read, search, send and organize that mail. There is no shared host: it is your server, it must be published to the internet, and you must connect using exactly the hostname on the certificate acme-mailcow issued. One inbox is free.

1 inbox free, forever Mailbox password from the mailcow UI Email fetched live, never stored

How mailcow connects: MAILCOW_HOSTNAME on 993

mailcow is a Docker Compose stack, and the mail half of it is Dovecot for IMAP and Postfix for submission, so the protocol behaviour is ordinary and well understood. What is specific to mailcow is the hostname. The stack has exactly one canonical name, MAILCOW_HOSTNAME, set in mailcow.conf at install time and never really changed afterwards, and that is the name to use as your IMAP and SMTP host. Dovecot answers on 993 with implicit TLS and 143 with STARTTLS. Postfix answers on 465 and 587. Credentials are the mailbox password you set under Mailboxes, not the admin password you use for the mailcow UI itself: those are separate accounts and the admin login is not a mailbox.

What your AI can do

A mailcow inbox your agent can actually use

Seventeen action-based MCP tools: send, reply, forward, schedule, and organize. Your agent finishes the job inside mailcow.

  1. 01Read

    Read & search mail

    List, read and search across folders to find that invoice, summarize a thread, or pull the latest from a sender.

  2. 02Send

    Send, reply & forward

    Compose and send real messages, reply in-thread, and forward, directly from your mailbox, not as a draft you finish by hand.

  3. 03Schedule

    Schedule for later

    Queue a message to go out at the right time, so your agent can draft now and send on schedule.

  4. 04Organize

    Move, copy, flag, archive, delete

    Keep the inbox tidy: file mail into folders, flag what matters, archive the rest, or delete on request.

Setup

Connect mailcow in four steps

From sign-up to first AI email in a couple of minutes.

01

Create a free account

Sign up for mcpemails, no card required. The free plan connects one inbox, forever.

02

Read MAILCOW_HOSTNAME out of mailcow.conf

On the host, grep MAILCOW_HOSTNAME /opt/mailcow-dockerized/mailcow.conf. That value, not the bare domain and not the machine's own name, is your IMAP and SMTP hostname, because it is the name acme-mailcow requested the certificate for.

03

Confirm the mailbox and its password

In the mailcow UI, open Configuration then Mailboxes. Confirm the address is active and, if you do not know its password, set a new one there. Then add the inbox in mcpemails: choose IMAP / SMTP, enter the MAILCOW_HOSTNAME host and the mailbox credentials.

04

Paste the MCP URL into your AI

Drop https://mcpemails.com/api/mcp into Claude, Cursor or ChatGPT, authorize, and your agent has the inbox.

Before you start

What actually goes wrong with mailcow

The certificate covers MAILCOW_HOSTNAME and almost nothing else

acme-mailcow requests a certificate for MAILCOW_HOSTNAME, plus autodiscover. and autoconfig. for every mail domain you add, plus anything you listed in ADDITIONAL_SAN. Your bare apex domain is not on that list. Connecting to yourdomain.com:993 therefore fails certificate validation even though the certificate is perfectly valid, because the name does not match. Use the MAILCOW_HOSTNAME value verbatim and the mismatch disappears.

SKIP_LETS_ENCRYPT leaves a snakeoil certificate that browsers hide from you

If SKIP_LETS_ENCRYPT=y is set in mailcow.conf, or acme-mailcow never completed a challenge, the stack keeps serving the self-signed certificate it generated at install. Everyone clicked through the browser warning months ago and forgot, so nothing looks broken locally, but a client that validates properly refuses the connection. Check what is really on the wire with openssl s_client -connect $MAILCOW_HOSTNAME:993 rather than trusting the UI.

Port 80 must stay reachable or the certificate quietly stops renewing

mailcow's ACME client uses the HTTP-01 challenge and the documentation is explicit that mailcow must be available on port 80 for it to work. Operators who firewall 80 off after setup, or park a different web server in front of the stack, get an issued certificate that renews for a while and then does not. IMAP on 993 keeps working until the day it expires, and then every client fails at once. If you cannot leave 80 open, switch the deployment to a DNS-01 challenge instead.

Publishing a port on a private interface hides the server from everything outside

The port bindings in mailcow.conf take an address as well as a port. A binding like IMAPS_PORT=127.0.0.1:993 is a normal way to run mailcow behind a proxy, and it means docker ps shows the container healthy while nothing outside the host can open the port at all. Confirm reachability from a machine on a different network before assuming credentials are the problem.

Known limits with mailcow

  • A hosted MCP server has to open an inbound IMAP connection to your stack, so mailcow published only on a private interface or reachable only through a VPN cannot be connected this way. mcpemails can be self-hosted alongside mailcow if you would rather nothing external touched 993.
  • Sending is handled by your own Postfix, so message acceptance downstream depends entirely on your SPF, DKIM and DMARC records and on whether your IP is listed anywhere.
FAQ

mailcow and AI: common questions

Does Claude work with mailcow?

Not on its own. Claude has no mailcow connector and cannot open an IMAP session to a server you run. Connecting an MCP server such as mcpemails to your mailcow install gives Claude read, search, send, reply, schedule and organize access to the mailboxes on it, in whichever MCP client you use.

What are the mailcow IMAP and SMTP settings?

The host is your MAILCOW_HOSTNAME, which you can read from mailcow.conf. IMAP is port 993 with implicit TLS, or 143 with STARTTLS. Submission is 465 with implicit TLS or 587 with STARTTLS. Log in with the full mailbox address and the password set for that mailbox in the mailcow UI.

Why is my mailcow login rejected?

The most common cause is using the mailcow admin account rather than a mailbox. The admin login exists only for the web UI and has no IMAP mailbox behind it. Confirm you are using an address that appears under Configuration then Mailboxes, and that the mailbox is active rather than disabled.

Is mailcow the same as Dovecot?

mailcow packages Dovecot as its IMAP server, along with Postfix, SOGo and Rspamd, in a Docker Compose stack with a web UI on top. Anything that is true of Dovecot's IMAP behaviour is true here, which is why our Dovecot page is worth reading if you need to change listeners or folder roles directly.

Is my mail stored on your servers?

No. Messages are fetched live from your mailcow server over IMAP for each request and passed to your AI client. Credentials are encrypted at rest and message bodies are not retained.

Give your AI a mailcow inbox

Connect a mailbox from your own stack. One inbox free forever, no card required.