Rafters Mail
Rafters Mail is a full-stack email framework for Cloudflare Workers. It handles inbound and outbound email, conversation threading, blob storage, classification, and a native IMAP server -- all without a third-party inbox.
The framework is built around a set of composable adapters. You bring your own auth, your own storage, and your own routing. Mail provides the protocol layer and the data model.
Getting started
If you are new to Rafters Mail, start here. These two pages get you from zero to receiving and sending email on a real Worker.
- Getting Started -- install, configure, and receive your first email
- Quickstart: Cloudflare -- a faster path if you already know Workers
Architecture
Understand how the framework is assembled before building on top of it.
- Architecture -- the full internal design reference
- Adapters Guide -- how adapters connect the core to vendors
Core
The schema, API surface, threading model, and database migration system.
- Core Reference -- the complete schema and API reference
- Threading -- RFC 5322 conversation grouping
- Migrations -- the inbox and newsletter table schema
Inbound and outbound
The full email processing pipeline: receiving, sending, storage, and classification.
- Inbound Email -- flow, InboundAdapter, and parsing
- Outbound Email -- compose, reply, EmailProvider, and webhooks
- Blob Storage -- BlobStorage interface and R2 implementation
- Email Classification -- Workers AI and DeBERTa-v3
- Newsletters and Broadcasts -- mailing lists and platform mirror tables
IMAP
Native IMAP support for connecting mail clients directly to your Worker.
- IMAP Quickstart -- pick a runtime, deploy, connect a client
- IMAP Command Reference -- full RFC-cited command list
- IMAP Authentication -- the AuthAdapter contract
- IMAP Deployment Guide -- Fly, Railway, Fargate, Docker, VPS