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:
| Approach | Problem |
|---|---|
| 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. |
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.
agent@yourdomain.com). Proper SPF/DKIM alignment because Namecheap controls both.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:
mx1.privateemail.com (priority 10)mx2.privateemail.com (priority 10)v=spf1 include:spf.privateemail.com ~allAdd to NanoClaw's .mcp.json:
No Gmail API, no OAuth, no Google Cloud project. Just IMAP credentials.
To see what the agent receives/sends, add the account to any IMAP client:
mail.privateemail.com, port 993 (IMAP), port 465 (SMTP)privateemail.com → login with agent credentialsBoth show the same inbox. This is for your visibility — the agent doesn't need a GUI.
| Project | Language | Features | Best 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.).
Even with a dedicated agent mailbox on your domain, prompt injection via email content remains a real threat:
Hidden text in emails instructs the agent to exfiltrate data. Works against any email-reading AI agent.[1]
Hidden commands in emails caused Gemini to leak data from connected services.[2]
Crafted email processed through MCP triggered code execution by chaining email content with shell tools.[3]
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.
| Option | Cost | IMAP? | Send as domain? | Complexity | Verdict |
|---|---|---|---|---|---|
| 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 |