A local mail daemon, MCP server, and CLI β built entirely in Swift.
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 Launch Agent 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, 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 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
- Instant discovery β CLI finds the daemon via Bonjour, zero config
- Always up-to-date β IDLE keeps mailbox state fresh
- Trigger scripts β run custom commands when new mail arrives
- macOS 14.0+
- Swift 6.0+
# Build
swift build
# Configure a server
post credential set --server work --host imap.company.com --port 993 --username you@company.com
# Create config
echo '{ "servers": { "work": {} } }' > ~/.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-to-markdown conversion |
| swift-argument-parser | CLI argument parsing |
| swift-log | Structured logging |
- 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
MIT β see LICENSE for details.