Skip to content

ananthb/cutout

Repository files navigation

Cutout

Transparent email alias proxy: similar to SimpleLogin or addy.io, built entirely on Cloudflare Workers. No servers, no containers, no monthly VM bills.

Deploy to Cloudflare

Documentation

How it works

  1. You own one or more domains with Cloudflare Email Routing (inbound) and Email Service (outbound)
  2. Someone emails anything@yourdomain.com
  3. Cutout worker is triggered, matches the recipient against your rules, and forwards the email to your real address
  4. For email destinations:
    • Native mode uses CF's native EmailMessage.forward(); original bytes (PGP, attachments) pass through untouched.
    • Proxy mode reconstructs the email via send_email to ensure Reply-To works reliably when replying via the same domain (strips signatures/attachments). Both modes inject an X-Original-From header for permanent archival in your inbox.
  5. For Telegram/Discord destinations: the bot posts the content to the chat and stores a reply context in KV. Replies in the chat (Telegram's native reply, Discord's "Reply" button → modal) route back to the original sender via email
  6. Destinations depend on your secrets: Telegram and Discord only appear in the UI when their bot tokens are configured

Getting Started

See the Deploy guide for step-by-step instructions on forking and deploying your own instance of Cutout to Cloudflare via GitHub Actions.

Features

  • Rule-based routing: ordered glob patterns on local and domain parts, evaluated top-to-bottom, first match wins; a *@* Drop catch-all is always pinned at the end
  • Dual-mode email forwarding: choose between high-fidelity Native mode (preserves PGP/attachments) and reliable Proxy mode (ensures Reply-To routing works via your custom domain)
  • Permanent Archival: an X-Original-From header is injected into all forwarded mail so you never lose the sender's identity even if KV mappings expire
  • Multi-destination forwards: one rule can forward to any mix of email / Telegram / Discord targets
  • Bot-relay replies: reply directly from Telegram or Discord chat; Cutout routes it back to the original sender via email
  • HTMX Management UI: clean, responsive web interface for managing rules, gated by Cloudflare Access
  • Safety first: automatic loop detection; kinds whose secrets aren't set are hidden from the UI and rejected by the validator
  • Live tester: each rule's inspector includes an interactive tester that evaluates a recipient address against this rule plus the full ruleset, highlighting which rule actually fires
  • Multi-domain: one worker serves any number of zones; rules use the domain glob to differentiate

Architecture

Development

nix develop        # enter dev shell with all tools
cargo test         # run tests
cargo clippy       # lint
wrangler dev       # local dev server
nix flake check    # run all CI checks (tests, clippy, fmt, pre-commit)

License

AGPL-3.0

About

Transparent email alias proxy built on Cloudflare Workers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors

Languages