rmail

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

Overview

rmail is a self-contained mail server implemented entirely in Python 3 standard library. It handles inbound and outbound email via SMTP, exposes mailboxes over IMAP4rev1, delivers messages to external domains through direct MX resolution or a configured smarthost, and provides a REST/JSON Exchange-style API for programmatic access.

There are no third-party dependencies. Storage is shard-based, using the filesystem with metadata encoded in filenames for lock-free flag operations and atomic updates under concurrent access.

Highlights

Documentation

Getting Started

Prerequisites, installation from source, initial configuration, and first-run example.

Usage

SMTP, IMAP, Exchange API, and CLI usage patterns with copy-pasteable examples.

Architecture

Module breakdown, data flow, storage model, and key design patterns.

Configuration

All configuration options grouped by subsystem with defaults and descriptions.

Advanced

Outbound relay internals, scaling, TLS operations, diagnostics, and storage migration.

Service Ports

PortProtocolTLS
25SMTPSTARTTLS
465SMTPSImplicit
587Submission (authenticated)STARTTLS
143IMAPSTARTTLS
993IMAPSImplicit
9002Exchange HTTP APINone
9003Exchange HTTPS APIImplicit