v0.2.0 released 16 November 2026, with calendars, rules and chainmail bootstrap.

Email for Claude Code and other AI agents

chainmail is a Go daemon that holds your mail passwords and checks every send against a policy. Claude Code reaches it over MCP, and you reach it from the CLI.

Claude Code sessions in a test mailbox

Every chainmail call in these recordings went through the daemon and its audit log.

Four limits the agent cannot change

No MCP tool or CLI command can change the policy.

Holds sends to strangers as drafts

A send to anyone off send_allow is saved to Drafts for you to review.

Wraps message text as untrusted

Subjects, senders and bodies arrive in an untrusted envelope, as data.

Refuses deletes unless you allow them

expunge and folder delete stay off, and unlisted, until the config allows them.

Audits every policy decision

An append-only log in state.db that never holds message content or secrets.

The vault

The daemon keeps every password and token in an age-encrypted vault, and no call ever returns one.

How chainmail connects Claude Code to your mail

Claude Code starts chainmail mcp, which holds no secrets and passes each call over a Unix socket to the daemon.

The daemon checks the policy, writes the audit row and talks IMAP and SMTP to your mail servers. The socket admits only the daemon's user and the chainmail-clients group.

Read the manual

Questions about chainmail

Anything else is in the manual, or open an issue on GitHub.

Ask on GitHub

Can Claude Code send mail by itself?

Yes, to your own accounts and to the addresses and domains in send_allow. A send to anyone else, or to more than max_recipients (10 by default), is saved to Drafts for you to send. How held sends work

Where are my passwords kept?

In an age-encrypted vault that only the daemon reads. No call returns a secret, and admin status lists secret names only.

What can an agent still get around?

An agent that can run sudo without a password can get around all of it, so run agents from an account that cannot. A dev daemon runs as you, so use it only for work on chainmail. trash, move and archive are not gated.

Which mail providers work?

Gmail and Google Workspace over OAuth2, Gmail with an app password, iCloud, Hostinger, and any IMAP and SMTP server that takes a password. Set up each provider

Does it work with agents other than Claude Code?

Yes. chainmail mcp speaks MCP over stdio, and the manual shows the Codex config. An agent that runs shell commands can use the CLI, which prints JSON when piped.

Which calendars work?

Google Calendar on Gmail and Google Workspace accounts that log in with OAuth2, and CalDAV servers such as Mailwright. Calendars arrived in v0.2.0.

Install chainmail in three steps

v0.2.0 runs on Linux and macOS. On NixOS, bootstrap writes Nix files for your configuration.

1

Install the binary

Homebrew installs chainmail with its shell completions and man page.

$ brew install yaklabco/tap/chainmail
$ chainmail version
2

Add an account

Bootstrap sets up the daemon as its own user, stores the account's password and tests the login. It asks for sudo once.

$ chainmail bootstrap [email protected]
$ chainmail accounts test you
3

Add chainmail to Claude Code

This registers the MCP server for every project.

$ claude mcp add --scope user chainmail \
    -- "$(command -v chainmail)" mcp