Transparent IMAP/SMTP proxy. Your AI agents run unchanged. Mailgator intercepts, applies your rules, and you keep control. Self-hosted. Single binary. Zero code changes.
# Airlock config — who can your AI email?
[smtp]
listen_addr = "127.0.0.1:2525"
upstream_addr = "smtp.gmail.com:587"
[imap]
listen_addr = "127.0.0.1:1143"
upstream_addr = "imap.gmail.com:993"
[[rules]]
to = "*@your-company.com"
action = "allow"
[[rules]]
to = "*@clients.com"
action = "ask" # hold for human approval
[[rules]]
to = "*"
action = "deny" # block everything else
Airlock sits between your AI agent and the real mail server. The agent connects to Airlock instead of Gmail/Outlook — no code changes needed.
Change the SMTP host from smtp.gmail.com to 127.0.0.1:2525. That's it.
Use glob patterns to allow, deny, ask, or log emails by recipient, sender, or subject.
Held emails appear in the web dashboard. Approve with a click, or let the LLM pre-filter handle routine ones.
Everything you need to safely give your AI agents email access, without the anxiety.
Full SMTP and IMAP proxy. Your AI agent connects as if talking to the real mail server — it never knows Airlock is there.
Glob-pattern matching on to, from, and subject fields. First-match-wins evaluation. Four actions: allow, deny, ask, log.
Emails matching ask rules are held in a queue. Approve or reject them from the web dashboard before they're sent.
Clean UI for managing held emails, reviewing logs, and monitoring what your AI agents are sending in real time.
Optionally let Claude auto-approve routine emails that match your criteria, so you only review the truly ambiguous ones.
Built-in Model Context Protocol server lets AI agents access mailbox contents through a structured, safe interface.
Edit your TOML config and Airlock picks up changes instantly. No restart needed, no dropped connections.
Written in Go. One binary, no dependencies, no Docker required. Download, configure, run. Works on Linux, macOS, and Windows.
Your agent already sends email via SMTP? Just change the host and port. That's the entire integration. No SDK, no API wrapper.
From customer support agents to invoice automation. See how teams keep AI in check.
AI responds to customer emails. External domains? Held for approval.
LLM drafts newsletters. Internal review first, then send freely.
Send to approved clients freely. Unknown recipients held.
Send prospecting emails. Block replies from non-targets.
Install, configure, start. Three commands and a TOML file.
# Install Airlock
$ curl -fsSL https://mailgator.io/install.sh | sh
# Start the proxy
$ mailgator serve --config mailgator-config.toml
INFO SMTP proxy listening on 127.0.0.1:2525
INFO IMAP proxy listening on 127.0.0.1:1143
INFO Web dashboard at http://127.0.0.1:8080
INFO Loaded 3 rules from config
INFO Watching config for changes...
_|
# Before (direct to Gmail)
smtp_host = "smtp.gmail.com"
smtp_port = 465
# After (through Airlock)
smtp_host = "127.0.0.1"
smtp_port = 2525
[smtp]
listen_addr = "127.0.0.1:2525"
upstream_addr = "smtp.gmail.com:587"
username = "agent@your-company.com"
password = "${SMTP_PASSWORD}"
[imap]
listen_addr = "127.0.0.1:1143"
upstream_addr = "imap.gmail.com:993"
[web]
listen = "127.0.0.1:8080"
[llm]
provider = "anthropic"
model = "claude-sonnet-4-20250514"
auto_approve = true
# Rules are evaluated top to bottom,
# first match wins.
[[rules]]
to = "*@your-company.com"
action = "allow"
[[rules]]
to = "ceo@big-client.com"
subject = "*invoice*"
action = "ask"
[[rules]]
to = "*@clients.com"
action = "log"
[[rules]]
to = "*"
action = "deny"
See how easy it is to define rules. This config takes 60 seconds to set up—just paste it, adjust your domains, and you're done.
See full example[[rules]]
to = "*@your-company.com"
action = "allow"
[[rules]]
to = "*@trusted-partners.com"
action = "allow"
[[rules]]
to = "*"
action = "ask"
Billed annually. No surprises.
Perfect for trying Mailgator.
30 days free. No credit card required.
Scale across your organization.
30 days free. No credit card required.
Get human oversight for AI-sent email in 60 seconds. Single binary, zero code changes, first-class developer experience.
$ curl -fsSL https://mailgator.io/install.sh | sh