Dev.to AI 🤖 Ai 👁 0 📖 3 min read

I built an open-source MCP server that lets ChatGPT manage 60+ mailboxes

Every morning I used to open more than 50 mailboxes, one by one. Client replies, payment notifications, leads, all scattered across servers and inboxes. Some mornings I missed one, and a missed reply can mean a lost clie

Every morning I used to open more than 50 mailboxes, one by one. Client replies, payment notifications, leads, all scattered across servers and inboxes. Some mornings I missed one, and a missed reply can mean a lost client.

So I built OpenMail, an open-source MCP server in Rust that lets ChatGPT manage all of them from one place. The full build is on video, and the code is on GitHub.

Video: https://www.youtube.com/watch?v=yB7uMU3NXAY
Repo: https://github.com/hanzlahabib/openmail

Why MCP

ChatGPT and Claude already connect to Gmail and Outlook, but one mailbox at a time, and they cannot send attachments. If your mail lives in many places, no single assistant sees all of it.

The Model Context Protocol fixes that at the right layer. One server owns mail access, and every MCP client talks to it. You ask in plain language: summarize my inbox, find the urgent client replies, draft answers.

What it does

OpenMail speaks plain IMAP and SMTP, so it works with Gmail, Outlook, Fastmail, iCloud, Yahoo, and any generic server. Up to 500 accounts, each with its own credentials, permissions, folder map, and connection limits.

Tools cover read, search, organize, draft, send, and daily briefs. Briefs are heuristic summaries of mailbox metadata: what needs a reply, what is waiting on you, what arrived overnight.

Security model

Email is the most sensitive data an assistant can touch, and mailbox text is attacker-controlled. OpenMail treats every message body as untrusted data, never as instructions.

Accounts default to read-only. Organize, draft, send, and delete are separate per-account permissions, enforced on every tool call. Sending needs a human-granted, single-use approval that lives outside the MCP tools, so a prompt injection cannot approve its own send. Config rejects inline secrets, only env var or keyring references. The HTTP edge refuses to start without TLS and an auth token, and there is no override flag.

How I built it

AI agents wrote most of the code while I watched. ChatGPT wrote the master prompt, terminal orchestration ran the agents, about four hours of work fast-forwarded in the video. My WSL crashed in the middle. Then I connected it to ChatGPT and tested it live with 62 mailboxes: summaries, priority replies, sent emails verified afterwards.

Honest status

OpenMail is pre-release, version 0.1.0. The tools are implemented and tested against a real IMAP/SMTP server (GreenMail), but it has not been tested against Gmail, Microsoft 365, or Dovecot yet, and it has not had an independent security audit. Binaries are unsigned. Read docs/RELEASE_READINESS.md in the repo before relying on it.

Quick start

Build from source (Rust 1.100+, edition 2024):

git clone https://github.com/hanzlahabib/openmail.git
cd openmail
cargo build --release -p openmail-cli --bin openmail-mcp
./target/release/openmail-mcp --version

Then run the wizard, check your config, and list accounts:

openmail-mcp init        # preset, account, permissions, config mode 0600
openmail-mcp doctor      # validates config and credential references
openmail-mcp accounts list

A client entry looks like this:

{
  "mcpServers": {
    "openmail": {
      "command": "openmail-mcp",
      "args": ["serve"],
      "env": { "OPENMAIL_PERSONAL_PASSWORD": "<app password>" }
    }
  }
}

Docker is supported too, with the HTTPS transport running as a non-root user.

Try it

If you manage more than one inbox, try it. If it saves you time, give it a star on GitHub. That is what keeps open source going.

How many inboxes do you check every morning?

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.