rmail

Production-grade mail server stack in pure Python 3 asyncio — SMTP, IMAP4rev1, and Exchange REST API.

Overview

rmail is a self-contained mail server implemented entirely in the Python 3 standard library. It exposes SMTP (ports 25, 465, 587), IMAP4rev1 (ports 143, 993), and an Exchange-style JSON/HTTP API (ports 9002, 9003) from a single process. Storage uses a Maildir-inspired shard-based filesystem layout that requires no database and supports concurrent access without per-mailbox locks.

Documentation

Getting Started

Installation, initial configuration, and first-run instructions.

Usage

SMTP, IMAP, and Exchange API usage with concrete examples.

Architecture

Module layout, data flow, storage design, and concurrency model.

Configuration

All configuration keys, defaults, rate limiting, and TLS options.

Advanced

Scaling, multi-process deployment, diagnostics, and signal handling.

Quick Start

git clone <repo> rmail
cd rmail
python run.py init          # generate config.json
python run.py               # start server
make user                   # create a user account

The server auto-generates a self-signed TLS certificate on first startup. Edit config.json to set your hostname and accepted domains before creating users.