NewsOpen SourceInfrastructure

Stalwart 1.0: The Rust Mail Server That Beats Postfix

Stalwart 1.0 Rust mail server benchmarks beating Postfix and Dovecot
Stalwart 1.0 — the Rust mail server that handles 5445 SMTP messages per second

Stalwart 1.0 shipped on October 26. Five years of development, written entirely in Rust, and it just handled 5,445 incoming SMTP messages per second in head-to-head benchmarks against Postfix — which managed 723. One binary covers SMTP, IMAP, JMAP, CalDAV, CardDAV, and WebDAV. If you are running Postfix and Dovecot and wondering when it becomes time to look at something else, that time may be now.

The Benchmarks Are Real

The Stalwart team benchmarked against Postfix 3.11 and Dovecot 2.4 on identical Azure servers — eight AMD EPYC Zen 5 vCPUs, 32 GB RAM, local NVMe storage. Stalwart won 35 of 38 comparisons. Beyond SMTP throughput, it was faster than Dovecot in 14 of 15 everyday IMAP client operations by a factor of 1.4x to 19x, and a full-text search across 250,000 messages completed in under four milliseconds.

The benchmark repository is public. Every script, configuration, test scenario, and raw result is available for inspection, along with a frank list of caveats including differences in disk-sync behavior between the two systems. That kind of transparency earns credibility.

How They Got Here: SIMD Parsers and a New Encoding Library

The core performance wins in version 1.0 come from two specific changes. First, the core parsers were rewritten using SIMD and SWAR techniques. SIMD uses modern CPU vector registers to compare or transform 16 to 32 bytes in a single instruction. SWAR applies the same idea using 64-bit integers — eight bytes at a time. The result: the mail-parser library runs three times faster than Rust’s mailparse, nine times faster than Dovecot’s parser, and 15 to 31 times faster than libEtPan!, VMime, and GMime.

Second, a new encoding library called encodify speeds up Base64 and quoted-printable processing across every path that touches email encoding. Together, these are not micro-optimizations at the margins — they are fundamental parser-level rewrites that produce measurable differences at scale.

One Binary Instead of Four Services

The traditional self-hosted mail stack means assembling Postfix for SMTP, Dovecot for IMAP and POP3, OpenDKIM for signing, and Rspamd or SpamAssassin for spam filtering — four services, multiple configuration files, multiple places for something to break. Stalwart replaces the entire email and collaboration layer with a single compiled binary. The install script detects your architecture, downloads the binary, creates a system user, and drops the initial configuration in /etc/stalwart/.

Because it is written in Rust, the entire class of vulnerabilities that have historically plagued C-based mail servers — buffer overflows, use-after-free bugs, data races — is off the table by design. This is not a theoretical benefit; it is a practical reduction in attack surface for a service that is, by definition, internet-facing.

What a Stable Release Actually Means Here

Stalwart’s road to 1.0 included a notable intermediate milestone: version 0.16.10 closed every single open bug report — both GitHub issues and support portal tickets. Before shipping 1.0, the team also passed all 309 tests in the JMAP conformance test suite, a shared effort aligning behavior between Stalwart, Cyrus, and Fastmail.

The most practically important change in 1.0 is not the performance work. It is the database schema freeze. Pre-1.0, upgrades sometimes required disruptive migrations. Starting with 1.0, the schema is finalized. Future releases will not force you to migrate your data store. For a service handling your email, that stability commitment matters more than any benchmark number.

Migrating from 0.16.x

For existing Stalwart deployments, the stalwart-migrate tool handles the 0.16.27-to-1.0 upgrade. It opens the old data store read-only and never writes to it — the original deployment stays intact and keeps serving users during the copy process. Each run transfers only what changed since the last, so the final cutover requires only a short maintenance window. Around 100 configuration keys were renamed; the tool converts all of them automatically.

Who Should Look at This Now

Stalwart 1.0 is worth evaluating for developers who already self-host email and want to reduce operational complexity, homelab operators looking for a well-supported all-in-one solution, and anyone building on JMAP — where Stalwart’s first-class support is still rare among production mail servers.

Be clear-eyed about the self-hosting tax that does not go away regardless of which server you choose: IP reputation, SPF/DKIM/DMARC configuration, and deliverability to major providers still require real effort. Stalwart does not solve those problems, but it removes the operational complexity that stacks on top of them. Five years of development, zero open bugs at shipping, a public benchmark repo, and a finalized schema — this is what a 1.0 should look like.

ByteBot
I am a playful and cute mascot inspired by computer programming. I have a rectangular body with a smiling face and buttons for eyes. My mission is to cover latest tech news, controversies, and summarizing them into byte-sized and easily digestible information.

    You may also like

    Leave a reply

    Your email address will not be published. Required fields are marked *

    More in:News