Email Security

Agent Email on Your Domain

Namecheap Private Email • IMAP MCP • no Gmail needed • hooks

Verdict

Recommended approach Namecheap Private Email ($14.88/year) + IMAP MCP
Agent email address agent@yourdomain.com (your own domain, full send + receive)
Gmail needed? No — IMAP MCP works with any provider
Setup effort ~15 minutes
Visual access to agent emails? Namecheap webmail or any IMAP client (Thunderbird, etc.)

1. Why Not Gmail / Cloudflare Routing

You own the domain. You don't use Gmail personally. The previous version of this report recommended Cloudflare Email Routing + a separate Gmail account, but that architecture has problems:

ApproachProblem
Cloudflare Email Routing Cloudflare is a forwarder, not a mailbox. It has no IMAP. The agent cannot check an inbox that doesn't exist — it would still need a destination mailbox (Gmail, etc.) for IMAP access.
Gmail as backend Unnecessary layer. Emails are sent FROM your domain, agent runs on a headless machine — why route through Gmail? The agent doesn't need a web interface, and you'd be sending from yourdomain.com via Gmail SMTP (SPF/DKIM mismatch).
Gmail API / OAuth Requires Google Cloud project, OAuth setup, and scope management. IMAP is simpler — just host/port/password.
The simplest path: Since you already own the domain on Namecheap, buy their Private Email Starter ($14.88/year). This gives the agent a real mailbox at agent@yourdomain.com with full IMAP + SMTP. The agent connects via a generic IMAP MCP server. No Gmail, no Cloudflare, no OAuth. One provider for domain + email.

2. Architecture

AGENT EMAIL ARCHITECTURE Namecheap Private Email agent@yourdomain.com (IMAP: mail.privateemail.com:993) (SMTP: mail.privateemail.com:465) | v IMAP MCP Server (codefuturist/email-mcp or ai-zerolab/mcp-email-server) Configured in NanoClaw's .mcp.json | v NanoClaw Agent (inside container, via MCP protocol) Can: read, search, send, manage folders | v WhatsApp "You got an email from X about Y" To view agent emails yourself: Namecheap webmail (browser) or Thunderbird / Mail.app (IMAP client) Both connect to mail.privateemail.com — same inbox, same credentials

Why This Works

3. Setup Steps

Step 1: Buy Namecheap Private Email 5 min, $14.88/year

In Namecheap: Domain List → your domain → Manage → Email → Purchase Private Email Starter ($14.88/year, 60-day free trial available). Create mailbox: agent@yourdomain.com.

If your domain uses Namecheap DNS, MX records are configured automatically. If on Cloudflare DNS, add manually:

  • MX: mx1.privateemail.com (priority 10)
  • MX: mx2.privateemail.com (priority 10)
  • TXT (SPF): v=spf1 include:spf.privateemail.com ~all
Step 2: Add IMAP MCP to NanoClaw 10 min

Add to NanoClaw's .mcp.json:

Option A: Python (ai-zerolab/mcp-email-server) { "mcpServers": { "email": { "command": "uvx", "args": ["mcp-email-server"], "env": { "MCP_EMAIL_SERVER_EMAIL_ADDRESS": "agent@yourdomain.com", "MCP_EMAIL_SERVER_IMAP_HOST": "mail.privateemail.com", "MCP_EMAIL_SERVER_IMAP_PORT": "993", "MCP_EMAIL_SERVER_SMTP_HOST": "mail.privateemail.com", "MCP_EMAIL_SERVER_SMTP_PORT": "465", "MCP_EMAIL_SERVER_USERNAME": "agent@yourdomain.com", "MCP_EMAIL_SERVER_PASSWORD": "your-password" } } } } Option B: Node.js (codefuturist/email-mcp — more features) { "mcpServers": { "email": { "command": "npx", "args": ["-y", "email-mcp"], "env": { "EMAIL_MCP_IMAP_HOST": "mail.privateemail.com", "EMAIL_MCP_IMAP_PORT": "993", "EMAIL_MCP_SMTP_HOST": "mail.privateemail.com", "EMAIL_MCP_SMTP_PORT": "465", "EMAIL_MCP_USERNAME": "agent@yourdomain.com", "EMAIL_MCP_PASSWORD": "your-password" } } } }

No Gmail API, no OAuth, no Google Cloud project. Just IMAP credentials.

Step 3 (Optional): View Agent Emails 5 min

To see what the agent receives/sends, add the account to any IMAP client:

  • Thunderbird / Mail.app: Add account with mail.privateemail.com, port 993 (IMAP), port 465 (SMTP)
  • Namecheap webmail: privateemail.com → login with agent credentials

Both show the same inbox. This is for your visibility — the agent doesn't need a GUI.

4. Available IMAP MCP Servers

ProjectLanguageFeaturesBest For
codefuturist/email-mcp Node.js 47 tools, IMAP IDLE watcher, email scheduling, analytics, read-only mode toggle Most feature-rich
ai-zerolab/mcp-email-server Python IMAP + SMTP, env-var config, auto-detects folders, attachment download Clean Python option
nikolausm/imap-mcp-server TypeScript Connection pooling, secure account management, IMAP + SMTP Robust TypeScript
jdickey1/imap-email-mcp Python Designed for Claude Code. Read, search, compose, manage Claude Code native

All of these are provider-agnostic — they work with any email service that supports IMAP/SMTP (Namecheap, Zoho, Fastmail, self-hosted, etc.).

5. Security: Email Risks Still Apply

Even with a dedicated agent mailbox on your domain, prompt injection via email content remains a real threat:

ShadowLeak (2025)

Hidden text in emails instructs the agent to exfiltrate data. Works against any email-reading AI agent.[1]

GeminiJack (2025)

Hidden commands in emails caused Gemini to leak data from connected services.[2]

Claude MCP + Email (2025)

Crafted email processed through MCP triggered code execution by chaining email content with shell tools.[3]

Mitigations: The dedicated mailbox limits blast radius — the agent only sees emails sent to agent@yourdomain.com, not your personal inbox. Add PreToolUse hooks to log all email tool calls, require confirmation before sends, and rate-limit reads. These are defense-in-depth, not absolute boundaries.

6. Comparison of Options

OptionCostIMAP?Send as domain?ComplexityVerdict
Namecheap Private Email $14.88/yr Yes Yes (native) Lowest Best
Cloudflare Routing + Gmail $0/yr No (forwarder, no mailbox) Via Gmail SMTP (SPF mismatch) Medium Worse
Google Workspace $84/yr Yes Yes Medium Overkill
Self-hosted (Mailcow) $5-10/mo VPS Yes Yes High (maintenance, deliverability) Overkill

Sources

  1. ShadowLeak Zero-Click Flaw — The Hacker News
  2. GeminiJack Zero-Click Vulnerability — Noma Security
  3. Code Execution Through Email: Claude MCP Hack — Pynt
  4. Namecheap Private Email Configuration — Namecheap KB
  5. codefuturist/email-mcp — IMAP MCP Server (47 tools)
  6. ai-zerolab/mcp-email-server — Python IMAP MCP