A local mail daemon, MCP server, and CLI β built entirely in Swift.
π Read the announcement β
Post pulls together SwiftMail, SwiftMCP, and SwiftText to give you a persistent, local-first email system that keeps tabs on multiple mailboxes across multiple IMAP servers.
Post is three things in one package:
A lightweight process that maintains persistent IMAP connections to all your configured mail servers. Optionally, it can use IMAP IDLE on any mailbox (INBOX, Sent, a custom folder, etc.) to get instant push notifications when messages arrive or change. When a change is detected, it can trigger a custom command β a shell script, a webhook call, whatever you need.
The daemon doubles as an MCP (Model Context Protocol) server, exposing your email to AI agents. Agents can list servers, search messages, fetch content, download attachments, move/copy/flag messages, draft emails, and more β all through a standardized tool interface.
A fast command-line client for searching, reading, downloading, and managing email. Communicates with the running daemon via local Bonjour + HTTP β no separate IMAP connections needed.
post list --server work --limit 10
post fetch 12199 --server work
post fetch 12198,12199 --eml --out ./backup
post search --from "amazon" --since 2025-01-01
post move 12345 Archive
post attachment 12199 --out ./downloads
post draft --to colleague@example.com --subject "Update" --body email.mdβββββββββββββββ ββββββββββββββββββββ
β post CLI ββββ Bonjour + HTTP ββββββΊβ β
βββββββββββββββ β βββββ IMAP IDLE βββΊ Mail Server 1
β postd daemon βββββ IMAP IDLE βββΊ Mail Server 2
βββββββββββββββ β βββββ IMAP IDLE βββΊ Mail Server 3
β AI Agents ββββ MCP (TCP) βββββββββββΊβ β
βββββββββββββββ ββββββββββββββββββββ
The daemon holds all IMAP connections. Both the CLI and AI agents talk to the daemon β never directly to mail servers. This means:
- Single connection pool β no duplicate IMAP sessions
- Local-only by default β daemon accepts connections from localhost only (secure by default)
- Instant discovery β CLI finds the daemon via Bonjour on the local machine
- Always up-to-date β IDLE keeps mailbox state fresh
- Trigger scripts β run custom commands when new mail arrives
Store credentials directly in config (simple) or in a hardware-bound macOS Keychain (recommended). Post creates a private keychain encrypted with your Mac's hardware UUID β credentials never leave your machine.
Draft rich HTML emails from plain markdown files. Post handles the conversion and creates drafts in your mail client, ready to review and send.
post draft --to team@company.com \
--subject "Weekly Update" \
--body weekly-update.mdCreate scoped API keys that limit which agents can access which mail servers. Perfect for sandboxed agents or multi-tenant scenarios.
post api-key create --servers work # Work-only token
post api-key create --servers personal # Personal-only tokenGet instant notifications when mail arrives. Perfect for automation workflows like invoice processing, newsletter archival, or notification routing.
Combine IDLE with handler scripts to build a "mail room" that automatically sorts incoming mail:
- Newsletters β Archived as markdown
- Service notifications β Organized by sender
- Spam β Filtered with AI (sandboxed, no access to personal data)
- Personal mail β Stays in inbox for your attention
Goal: Inbox Zero through intelligent, automated triage.
- macOS 14.0+
- Swift 6.0+
# Build
swift build
# Add credentials to secure keychain
post keychain add personal --host imap.gmail.com --port 993
# Create config
echo '{ "servers": { "personal": {} } }' > ~/.post.json
# Start the daemon
postd startπ Daemon Setup & Configuration β β configuration options, IMAP IDLE, Launch Agent setup, credential management
| Package | Purpose |
|---|---|
| SwiftMail | IMAP/SMTP client library |
| SwiftMCP | Model Context Protocol server framework |
| SwiftText | HTML/PDF/DOCX to markdown conversion |
| swift-argument-parser | CLI argument parsing |
| swift-log | Structured logging |
- mail-room β OpenClaw skill for automated email sorting and archival
- Agent Skills β Standard for building reusable AI agent tools
- OpenClaw β Agentic platform that inspired Post's design
- Identity-based access control β assign different identities to different agents, restricting which mailboxes and servers each agent can see
- Permission levels β fine-grained access tiers:
- Read-only
- Archive-only
- Allow trash/delete
- Allow creating drafts
- Allow sending
- Multi-agent isolation β ensure agents only see what they're supposed to see
- Homebrew distribution β easy installation via
brew install cocoanetics/tap/post - ClawHub skill β pre-packaged OpenClaw skill for easy integration
MIT β see LICENSE for details.
Built with β€οΈ by Oliver Drobnik β’ Blog β’ GitHub
