Public Preview · #![forbid(unsafe_code)] · MIT / Apache-2.0

One binary. Sovereign email & zero-knowledge agent control.

Muddle Box replaces a 19-container legacy mail stack (Postfix, Dovecot, Rspamd, Roundcube, Redis, Solr) and dozens of scattered inbox tabs with a single 13 MB pure-Rust binary—delivering sub-10 ms search, verifiable cryptographic delivery, OpenMLS end-to-end encryption, and human-gated AI automation.

Compiled Binary
13 MB
Idle Resident Memory
< 30 MB
Cross-Mailbox FTS5 Search
< 10 ms
Unsafe Rust Blocks (18 Crates)
0
Cargo Audit Advisories
0

Progressive Disclosure

Core reliability on Day 0. Cryptographic & AI capabilities when you opt in.

Start with a hardened single-binary mail server and unified inbox, then enable agent automation, stranger screening, zero-knowledge E2EE, embeddable portals, or dynamic home hosting without adding external services.

Day 0 Core MTA / MDA / JMAP

Single-Binary Mail Server

Clean-room SMTP (25), Submission (587), IMAP4rev2 (143/993 with live IDLE), and RFC 8620/8621 JMAP. Ships dual Ed25519 + RSA-2048 DKIM, SPF/DMARC enforcement, greylisting, opt-in DNSBL/URIBL, and Deliverability Autopilot for DMARC RUA and TLS-RPT reports.

Day 0 Core Webmail & FTS5

Unified Multi-Domain Webmail

Sub-10 ms SQLite WAL + FTS5 search across 34+ mailboxes, keyboard-first triage, ⌘K command palette, Undo Send, Snooze, Scheduled Send, Keeper delete-protection tags, RFC 6068 mailto: registration, and sandboxed HTML isolation.

Opt-In CAPMail + RFC 9420

Front Porch & OpenMLS E2EE

Strangers knock at the Front Porch with BLAKE3 proof-of-work for Inbox approval. Supports attenuated Ed25519 capability tokens, two-box pairing, and browser Web Worker OpenMLS RFC 9420 TreeKEM where the server holds only opaque ciphertext.

Opt-In /mcp + stdio

AI & MCP Control Plane

Connect Claude Desktop, Cursor, Antigravity, TypeScript (@muddle/sdk), or Python (muddle-sdk) agents using mailbox- or domain-scoped tokens. Guarded by prompt-injection quarantine, session taint tracking, Inbox HITL approvals with rendered previews, and a global kill switch.

Opt-In ops.dns / ops.policy

Domain Admin Control Plane

Delegate DNS and mailbox lifecycle via ops.dns, ops.domains, ops.mailboxes, and ops.policy without granting mail.read or mail.send. Includes staged zero-downtime DKIM rollover, dynamic per-domain MTA-STS, and tenant-isolated Cloudflare DNS sync with LIFO rollback.

Opt-In <muddle-mail> + Relay

Muddle Portal & Home Mode

Embed zero-cookie, ephemeral P-256 ECDH Proof-of-Possession webmail widgets with SQLite-per-box isolation and strict origin allowlists. Or self-host from residential NAT/CGNAT using 2-of-2 STUN quorum IP tracking and the encrypted muddle-edge-relay bridge.

Defense-in-Depth

Verifiable security invariants from socket to storage.

Built from first principles so host isolation, cryptographic boundary enforcement, and anti-footgun defaults hold even under hostile mail input or compromised agent sessions.

Memory & Supply Chain #![forbid(unsafe_code)]

Zero Unsafe Rust & Clean Audit

#![forbid(unsafe_code)] spans all 18 workspace crates including Layer-0 wire, crypto, and kernel primitives, paired with pure-Rust rustls across SMTP, IMAP, HTTPS, and CAPMail. Legacy advisories for RSA DKIM, P-256 PoP, and Curve25519 were eliminated on aws-lc-rs and v3 curves (0 cargo audit vulnerabilities).

At-Rest & Session Crypto XChaCha20-Poly1305 + AAD

Fail-Closed Vault & Domain-Bound AAD

Argon2id credential hashing, zeroize on drop, constant-time CSRF, and Sec-Fetch-Site: same-origin checks. Stored secrets bind explicit context AAD (e.g., provider_aad(domain) and muddle-admin-totp-v1) to defeat ciphertext transplantation. When locked, APIs return 423 Locked and unauthenticated callers see zero vault-state oracle.

Browser Boundary Strict CSP + Sandbox

Zero Inline Script & Isolated HTML Bodies

Webmail enforces script-src 'self' 'wasm-unsafe-eval', style-src 'self', zero 'unsafe-inline' or 'unsafe-eval', server-side ammonia sanitization, proxied remote images, and <iframe sandbox="" srcdoc> rendering so untrusted emails never execute scripts or phone home.

Edge & Proxy Hardening X-Muddle-Proxy-Auth

Authenticated Proxy Hops & Smuggling Defense

Loopback-only /_internal/tls-ask and /_internal/metrics reject forwarded headers. Reverse-proxy IP trust requires a >= 32-byte BLAKE3-verified X-Muddle-Proxy-Auth secret. Listener limits enforce strict Content-Length/Transfer-Encoding parsing, per-request header deadlines, /64 IPv6 bucketing, and CatchPanicLayer.

Agent Containment mcp-audit-verify

Separation of Duties & Hash-Chained Audit

Tokens enforce single-mailbox or domain boundaries via check_token_domain and block mixing mail.read with ops.* write scopes. Reading untrusted mail taints the session, routing outbound sends and policy changes through Inbox HITL approval while every tool call appends to a SHA-256 hash-chained, Ed25519-signed log.

Operational Resilience BLAKE3 + WAL Backup

Hot-Reload TLS & Verified Online Backups

ReloadableCertResolver requires 0600 non-symlink private keys and reloads cleanly on SIGHUP while keeping the prior valid certificate on error. Online backups (muddle-box backup) snapshot SQLite WAL databases under read-lock protection, verify every BLAKE3 compressed blob, and validate SHA-256 manifests before atomic restore.

Standards & Modularity

Every mail standard & protocol in one workspace.

Run standard mail clients, modern JMAP apps, or CAPMail/MCP endpoints from the same process with strict host-level isolation.

Service / Endpoint Protocol / Standard Default Bind Production Surface
Inbound MTA SMTP + STARTTLS, SPF, DMARC, Greylist, DNSBL 127.0.0.1:2525 0.0.0.0:25
Mail Submission SMTP Submission + STARTTLS + AUTH 127.0.0.1:2587 0.0.0.0:587
IMAP4rev2 RFC 9051 IMAP4rev2 + STARTTLS / Implicit TLS + IDLE 127.0.0.1:2143 / 2993 127.0.0.1:143 · 0.0.0.0:993
JMAP RFC 8620 / RFC 8621 (/.well-known/jmap, /jmap) 127.0.0.1:8080 Mail host behind Caddy TLS
CAPMail & Mode B /.well-known/capmail.json, Front Porch, OpenMLS 127.0.0.1:8080 Mail host behind Caddy TLS
AI Control Plane Streamable HTTP /mcp & muddle-box mcp-stdio 127.0.0.1:8080 Bearer-authenticated /mcp
Muddle Portal Zero-cookie P-256 PoP (/portal/..., /sdk/muddle-mail.js) 127.0.0.1:8080 Isolated box subdomains
MTA-STS & TLS Oracle Per-domain RFC 8461 policy + loopback /_internal/tls-ask 127.0.0.1:8080 mta-sts.<domain> · Loopback only
muddle-box muddle-web muddle-store muddle-smtp muddle-imap muddle-jmap muddle-mcp muddle-capmail muddle-mls-wasm muddle-portal muddle-filter muddle-home muddle-edge-relay

60-Second Quick Start

Deploy on local Rust, Docker, or bare-metal Linux.

One initialization command provisions your domain, generates dual Ed25519 + RSA-2048 DKIM keys, creates your admin mailbox, and hashes your Argon2id admin password via stdin.

Compile release binary and initialize via stdin
cargo build --release -p muddle-box

read -rsp "Admin password: " ADMIN_PASSWORD && echo
printf '%s\n' "$ADMIN_PASSWORD" | ./target/release/muddle-box --data-dir ./dev-data init \
  --domain example.com \
  --admin-email admin@example.com \
  --admin-password-stdin
unset ADMIN_PASSWORD

./target/release/muddle-box --data-dir ./dev-data serve --domain example.com