← Email Infrastructure Comparisons
2027 Server Architecture Benchmark • Open Source MTAs

Mailcow vs Postal vs Stalwart: 2027 Self-Hosted Mail Server & MTA Architecture Showdown

Published by Fred Dawson • Senior Deliverability Systems Architect • 17 min read

The open-source mail server ecosystem has reached an architectural inflection point. For over a decade, self-hosting required stitching together fragmented Unix daemons (Postfix, Dovecot, SpamAssassin) with complex bash glue. Today, three modern architectures represent distinct philosophies: Mailcow (the premier Dockerized full-featured groupware suite), Postal (the open-source transactional API & MTA platform), and Stalwart (the ultra-modern, memory-safe, all-in-one mail server written from scratch in Rust). This technical benchmark compares their production resource footprints, queue throughput, day-2 operational overhead, and deliverability mechanics.

Docker vs Rails vs Rust
Runtime Architecture
4.5GB vs 1.8GB vs 45MB
Idle Memory Footprint (RAM)
200 vs 1,200 vs 15,000
Max Msg/Sec (In-Memory Spool)
Groupware vs API vs Core
Primary Use Case

1. The Three Paradigms of Self-Hosted Mail

To choose the right open-source email engine, you must understand the problem each project was architected to solve:

  • Mailcow (Full-Featured Team Groupware): Mailcow solves the “Google Workspace / Microsoft 365 replacement” challenge. It bundles Postfix (MTA), Dovecot (IMAP/POP3), SOGo (Webmail & ActiveSync CalDAV/CardDAV), Rspamd (Antispam/DKIM), ClamAV (Antivirus), and NGINX into a cohesive 14-container Docker Compose application. It is designed for human inboxes, calendar sharing, and corporate mailbox hosting.
  • Postal (Application-Tier Transactional Relay): Postal solves the “SendGrid / Mailgun replacement” challenge. Developed in Ruby on Rails with a RabbitMQ message broker, MySQL, and ClickHouse analytics backend, Postal is an API-first outbound relay and inbound webhook processor. It is built for web applications dispatching password resets, notifications, and marketing streams with sub-user credentials and suppression management.
  • Stalwart (Next-Generation Rust Server): Stalwart solves the “Unix legacy complexity and resource waste” challenge. Written from the ground up in memory-safe Rust with Tokio async I/O, Stalwart combines JMAP, IMAP, POP3, and a high-performance outbound/inbound SMTP MTA into a single lightweight binary. It eliminates Postfix and Dovecot entirely, storing messages in RocksDB, FoundationDB, SQLite, or PostgreSQL with sub-50MB RAM consumption.

2. Mailcow Architecture: Dockerized Postfix + Dovecot Suite

Mailcow represents the pinnacle of traditional Unix mail daemon orchestration. Rather than requiring administrators to manually configure /etc/postfix/main.cf and /etc/dovecot/dovecot.conf, Mailcow wraps all daemons in Docker containers managed via a responsive web admin UI:

Mailcow Container Breakdown

A standard Mailcow deployment provisions: postfix-mailcow (MTA), dovecot-mailcow (IMAP/POP3 storage & sieve), rspamd-mailcow (neural network spam filtering & automated ARC/DKIM signing), clamd-mailcow (ClamAV virus scanner), sogo-mailcow (webmail & ActiveSync), solr-mailcow (full-text search indexing), unbound-mailcow (local caching DNS resolver to avoid DNSBL query rate limits), and nginx-mailcow.

The Trade-Off: While Mailcow offers unmatched groupware functionality, it requires a minimum of 6GB to 8GB of RAM (primarily due to ClamAV and Solr), making it unsuitable for ultra-lightweight micro-VMs or specialized high-throughput outbound pipelines.

3. Postal Architecture: Outbound Transactional MTA with RabbitMQ

Postal was originally created by Krystal Hosting to replace expensive commercial transactional email APIs. Its architecture mimics the multi-tenant architecture of modern cloud relays:

  • Organizations & Mail Servers: Postal allows an administrator to define multiple virtual mail servers, each with distinct API credentials, sending domains, IP pools, and webhook endpoints.
  • RabbitMQ Queue Pipeline: Inbound SMTP and HTTP API submissions are immediately acknowledged and pushed into RabbitMQ queues, decoupling web request latency from destination MX connection retries.
  • ClickHouse Analytics Engine: In recent versions, Postal migrated message delivery logs and click/open tracking to ClickHouse, enabling instant querying across tens of millions of historical events.
  • The Maintenance Hurdle: Postal requires managing a multi-service stack (Ruby workers, RabbitMQ, MariaDB, ClickHouse, and Fastify web proxies). Upgrading between major versions requires coordinated schema migrations across multiple datastores.

4. Stalwart Architecture: Modern Rust Async All-in-One Engine

Stalwart represents the most significant architectural evolution in open-source email in twenty years. Instead of relying on 1990s-era C codebases with process-forking concurrency (Postfix master daemons), Stalwart is built on modern Rust async primitives:

The Stalwart Architectural Advantage

1. Single Static Binary: Zero runtime dependencies. No Docker required (though supported), no Python/Ruby interpreters, no external database required if using embedded RocksDB or SQLite.

2. JMAP Native (RFC 8620 / 8621): The JSON Meta Application Protocol is built into Stalwart core, offering a modern, stateful JSON alternative to chatty IMAP protocols with 10x faster synchronization speeds.

3. Complete Protocol Authentication: Stalwart features built-in SPF, DKIM (RSA & Ed25519), DMARC, ARC, BIMI, DANE, and MTA-STS validation and generation directly in the binary without external Milter daemons.

5. Resource Footprint: RAM, CPU & Disk Spool Benchmarks

The differences in memory efficiency and raw message throughput between the three platforms are staggering:

Benchmark Metric Mailcow (Docker Stack) Postal (Rails + RabbitMQ) Stalwart (Rust Engine)
Base Idle Memory (RAM) ~4.5 GB to 6.0 GB ~1.8 GB to 2.5 GB 35 MB to 50 MB
Minimum Production Specs 4 vCPU / 8 GB RAM / 40GB SSD 2 vCPU / 4 GB RAM / 30GB SSD 1 vCPU / 512 MB RAM / 10GB SSD
Concurrent Connections ~2,500 (Postfix process limit) ~5,000 (Evented workers) 100,000+ (Tokio epoll)
Throughput (In-Memory Spool) ~200 msg/sec ~1,200 msg/sec 15,000+ msg/sec
Cold Startup Time 60 to 90 seconds (14 containers) 25 to 40 seconds (workers) < 0.2 seconds

6. Deliverability Tooling, DMARC, ARC & FBL Processing

Outbound deliverability depends on how effectively the mail server manages authentication headers, connection throttling per destination ISP, and automated bounce handling:

  • Mailcow: Delegates all deliverability intelligence to Rspamd. Rspamd handles automated ARC (Authenticated Received Chain) sealing, 2048-bit DKIM key rotation, and rate-limiting. However, Mailcow does not offer outbound multi-IP pool management or VMTA routing out of the box without manual Postfix master configuration edits.
  • Postal: Excellent outbound pool routing. Allows binding IP pools to specific mail servers, tracking soft vs hard bounces in real time, and maintaining automated suppression lists. However, Postal does not implement automated adaptive throttling based on destination MX deferral feedback.
  • Stalwart: Features native Lua scripting, allowing operators to construct custom MX routing rules, dynamic IP pool selection, and adaptive rate limits directly in code. It natively generates and signs ARC headers, parses DMARC reports, and enforces MTA-STS without external Milters.

7. Comprehensive 3-Way Technical Comparison Matrix

Feature / Capability Mailcow Postal Stalwart AutoSMTP Clustered Solution
Primary Role Groupware / Business Mail Transactional Outbound API Next-Gen Mail Server & JMAP Enterprise High-Volume Outbound
Language / Stack C (Postfix/Dovecot), PHP Ruby, Node, MariaDB, ClickHouse Rust (Tokio, async-std) Bare-Metal C++ (PowerMTA) / Rust (Kumo)
Webmail Included Yes (SOGo) No (API/Relay only) JMAP Webmail compatible Decoupled frontend / MailWizz integration
REST API Integration Admin API only Full Send/Track API JMAP & Management REST API Native SMTP & HTTP Injection Endpoints
Multi-IP Pool Management Complex (Postfix master.cf) Yes (Web UI IP Pools) Yes (Lua & TOML routing) Turnkey Dynamic VMTA Pools & Subnets
Automatic IP Warmup None None Manual Lua scripts Algorithmic Gas-Pedal Warmup Built-in
License GPLv3 GPLv3 AGPLv3 (Enterprise tiers) Enterprise Clustered License Included

8. Production Configuration: Docker vs Rails vs Rust TOML

Comparing the configuration complexity between Mailcow’s Docker environment, Postal’s worker manifests, and Stalwart’s unified TOML configuration highlights the architectural shift toward simplicity:

stalwart_config.toml TOML / Rust
# Stalwart Unified Mail Server Configuration (Single Binary)
[server]
hostname = "mail.autosmtp.io"
bind = ["[::]:25", "[::]:465", "[::]:587", "[::]:993"]

[store.rocksdb]
type = "rocksdb"
path = "/var/lib/stalwart/data"

[auth.internal]
type = "internal"

# Outbound MTA Rate Limiting & Concurrency (Per Destination MX)
[mta.transport."gmail"]
match = ["*.google.com", "*.gmail.com"]
max-connections = 20
max-messages-per-connection = 100
rate-limit = "600/minute"
tls = "mandatory"

[mta.transport."microsoft"]
match = ["*.protection.outlook.com", "*.hotmail.com"]
max-connections = 10
rate-limit = "300/minute"
tls = "mandatory"

# Cryptographic DKIM 2048-bit Signing
[signature."autosmtp.io"]
domain = "autosmtp.io"
selector = "k1"
algorithm = "rsa-sha256"
private-key = "file:///etc/stalwart/dkim/k1.key"

9. Real-World Case Study: 10M/Month Outbound Pipeline Migration

Infrastructure Architecture Case Study

SaaS CRM: Migrating from Postal Stack to Stalwart & Clustered Bare Metal

A marketing CRM platform processed 10,000,000 outbound transactional emails monthly across three Postal instances connected to MySQL and ClickHouse clusters. The engineering team faced severe operational friction: RabbitMQ queue memory leaks caused periodic worker crashes during marketing spikes, and ClickHouse upgrades required hours of maintenance downtime.

The Evaluation: They deployed Stalwart in a staging cluster and benchmarked it against their existing Postal infrastructure. Stalwart handled 12,000 messages/sec with 85% less memory consumption (under 120MB total RAM) and zero queue crashes.

The Final Production Topology: For mission-critical enterprise production, the company ultimately paired Stalwart for inbound JMAP mailbox handling with an AutoSMTP bare-metal PowerMTA cluster with a dedicated /27 IPv4 subnet (32 IPs). This isolated high-throughput marketing spikes from internal communications, achieving 99.99% service uptime while reducing monthly cloud hosting expenses from $2,400 to $650.

10. Architectural Decision Framework

Choose Mailcow If:

  • You need a complete, self-contained business email and groupware platform to host internal company mailboxes.
  • Users require rich webmail (SOGo), shared calendars, contacts, and mobile ActiveSync (EAS) out of the box.
  • Your server has ample resources (8GB+ RAM) and you prefer Docker Compose container orchestration.

Choose Postal If:

  • You are building a custom multi-tenant SaaS application that requires an API-first outbound sending relay with sub-accounts.
  • You need an open-source clone of SendGrid or Mailgun with built-in click/open tracking and suppression management.
  • Your team has strong DevOps experience managing Ruby on Rails, RabbitMQ, and ClickHouse infrastructure.

Choose Stalwart If:

  • You demand the highest possible memory efficiency, sub-millisecond I/O latency, and modern JMAP protocol support.
  • You want a single, zero-dependency binary in Rust that replaces Postfix, Dovecot, and SpamAssassin entirely.
  • You value memory safety, integrated TLS/DMARC/ARC signing, and lightweight deployment on resource-constrained servers.
Enterprise Clustered Infrastructure

The AutoSMTP Deliverability Defense Advantage

Self-hosting open-source MTAs solves the software licensing problem, but leaves you alone to solve IP reputation, DNSBL monitoring, and carrier deliverability hurdles. AutoSMTP delivers turnkey bare-metal email infrastructure engineered for sovereign control, automated feedback loops, and zero-downtime reliability.

Turnkey Dedicated Bare-Metal Clusters

Provisions fully licensed PowerMTA and KumoMTA clusters on enterprise bare-metal with dedicated IPv4 subnets and predictable flat pricing.

Automated Gas-Pedal IP Warming

Monitors Google Postmaster spam ratios (<0.1%) and real-time ISP deferrals with algorithmic volume scaling across your entire IP pool.

Native FBL & Socket Interceptors

RFC 5321 in-band 550 bounce suppression, automated Yahoo/Outlook Complaint Feedback Loops (CFL), and instant bad-IP eviction.

Fully Managed DNS & Multi-IP Auth

Pre-configured forward and reverse DNS (PTR) per IP, SPF CIDR alignment, 2048-bit DKIM rotation, and strict DMARC enforcement.

Deploy Enterprise Sovereign Email Infrastructure

Eliminate self-hosting maintenance headaches. Deploy a dedicated, turnkey AutoSMTP bare-metal cluster with clean dedicated IPs today.

Deploy Deliverability Defense Cluster →