Ferroma docs
Rust-nativeSelf-hostedMIT OR Apache-2.0

Ferroma

A Rust-native, self-hosted mail platform — its own SMTP and IMAP servers, its own MIME core, its own storage engine. It does not wrap Postfix or Dovecot. The point is to own the whole stack.

一个 Rust 原生、可自托管的邮件平台——自研 SMTP 与 IMAP 服务器、自研 MIME 邮件核心与存储引擎,不封装 Postfix、Dovecot 等任何现有邮件服务器,目标是掌握全部技术栈。

                              FERROMA
                                 │
      ┌──────────────────────────┼──────────────────────────┐
      │                          │                          │
   Webmail                Official Clients               Admin
      │                          │                          │
      │                    ┌─────┼─────┐                    │
      │                    ▼     ▼     ▼                    │
      │                  Win   Linux  macOS                 │
      │                                                      │
      └──────────────────────────┼──────────────────────────┘
                                 │
                        Client API (FCP) / HTTP API
                                 │
                         ┌────────▼────────┐
                         │  Ferroma Core   │
                         └────────┬────────┘
                                  │
       ┌───────────┬─────────────┼─────────────┬───────────┐
       ▼           ▼             ▼             ▼           ▼
     SMTP        IMAP         Storage        Queue        DNS
       │           │             │             │           │
       └───────────┴─────────────┼─────────────┴───────────┘
                                 │
                            Event Bus ── WebSocket ── Push
                                 │
                             PostgreSQL

What it is · 它是什么

One mail core

单一邮件核心

SMTP, IMAP, Webmail and the Client API all go through ferroma-mail — one implementation of every operation.

SMTP、IMAP、Webmail 与客户端 API 全部经由 ferroma-mail——每个操作只有一份实现。

Never an open relay

永不开式中继

Unauthenticated peers deliver only to local domains, enforced at the protocol edge.

未认证的对端只能投递到本地域,这条规则在协议边缘强制执行。

Server = source of truth

服务器即真相

Clients keep a cache and a cursor; the change log and its sequence numbers keep the truth.

客户端只保留缓存与游标;变更日志及其序列号保存真相。

Nothing is lost

数据不丢失

Client operations carry an idempotency key and survive a crash mid-request.

客户端操作携带幂等键,请求中途崩溃也能安全重放。

rustls everywhere

全线 rustls

One TLS implementation, in Rust. No OpenSSL, no schannel.

只使用一种 Rust 实现的 TLS。不用 OpenSSL,也不用 schannel。

Realtime event bus

实时事件总线

mail.received and friends replay for reconnecting clients over WebSocket.

mail.received 等事件可对重连客户端重放,经 WebSocket 推送。

Documentation · 文档

Architecture架构总览系统组成、crate 依赖图,以及它为何如此设计。SMTPSMTP入站与出站 SMTP、应答码、开放中继策略。IMAPIMAPIMAP4rev1、文件夹、UID、标志与客户端兼容性。HTTP APIHTTP API全部 HTTP 端点及示例。FCPFCPFerroma 客户端协议:同步游标、实时事件、设备。Sync Model同步模型深入解析同步机制。Storage存储数据库模式、Maildir、配额、附件与完整性。Desktop Client桌面客户端官方客户端的架构与功能。Security安全威胁模型、每项安全控制及已知缺口。Deployment部署DNS、TLS、备份、升级与故障排查。 Glossary术语表Ferroma 中英术语对照。

Quick start · 快速开始

git clone https://github.com/ferroma/ferroma && cd ferroma
cp .env.example .env    # POSTGRES_PASSWORD / FERROMA_HOSTNAME / FERROMA_JWT_SECRET
docker compose up -d
docker compose logs -f ferroma

完整部署说明(DNS、TLS、DKIM、备份与升级)见 Deployment中文版部署文档