Skip to main content

Mailezine Engine

The in-house engine powering every mailez edition: a single binary with pluggable storage, replacing the classic Postfix + Dovecot stack with built-in Rspamd integration.

Why Mailezine?

Traditional mail systems are assembled from many independent components — complex to operate and hard to debug. Mailezine redefines the mail engine as a single binary, and now powers every mailez edition.

Traditional (Postfix + Dovecot)

  • ❌ 5+ components you install, wire up and tune yourself (Postfix, Dovecot, Rspamd, Unbound, nginx)
  • ❌ Components talk over sockets/pipes — hard to debug
  • ❌ Config scattered across files with different formats
  • ❌ Depends on system package management; upgrade risk
  • ❌ Linux only; Windows development needs WSL
  • ❌ Storage bound to Maildir — no choice

Mailezine

  • ✅ Single binary for the mail core — SMTP, IMAP, ManageSieve, queue and DKIM signing; spam filtering comes pre-wired through Rspamd
  • ✅ In-process calls, zero IPC overhead
  • ✅ Unified config: environment variables + YAML
  • ✅ Statically compiled, cross-platform deployment
  • ✅ Native Linux / macOS / Windows support
  • ✅ Pluggable storage (Pebble / TiDB, bodies on S3 object storage)

Core Features

📦

Single-binary deployment

One executable carries the mail core — SMTP, IMAP, ManageSieve, queue and DKIM signing. No dependencies, no package manager — copy and run.

💾

Pluggable storage

Multiple storage backends to choose from: TiDB (distributed KV, the production default for horizontal scaling) and Pebble (pure-Go LSM, default for local development); message bodies can live in local FS or MinIO/S3 object storage. Same code, same tests.

🔌

Complete protocols

Full SMTP send/receive, Submission, IMAP, POP3 and ManageSieve support — production-proven protocol implementations.

🛡️

Pre-integrated anti-spam

Seamless Rspamd scanning (wired into the compose stack by default) with DKIM/DMARC verification; outbound mail is signed automatically, inbound mail verified.

🚀

Zero IPC overhead

Where Postfix and Dovecot communicate over sockets, Mailezine does everything in-process. Lower latency, higher throughput.

🌐

Native cross-platform

Statically compiled Go runs natively on Linux / macOS / Windows. No WSL, no VMs — a consistent development experience.

☁️

Object storage

Message bodies can be stored on S3/MinIO for large-scale deployments; metadata lands on TiDB KV or Pebble. Local FS and cloud storage switch through one unified interface with zero code changes.

🔍

Full-text search

Embedded FTS index (bleve), with optional Tika extraction of PDF / Office / ODF attachments — attachment text is searchable too.

⚖️

HA & horizontal scaling

Active-passive lease failover with automatic takeover; on TiDB + S3, instances scale horizontally and capacity and throughput grow linearly with the storage layer.

🧪

End-to-end tests

Complete e2e coverage: SMTP→storage, SMTP→IMAP, relay enqueue, Sieve→Junk. Every commit verified automatically.

Measured benchmark: Mailezine vs the traditional mail stack

10,000-user enterprise load, same machine, same load tool — an A/B comparison of both stacks.

MetricTraditional stack (Postfix + Dovecot)MailezineGainWhat it means
Inbound throughput3.1 msg/s13.6 msg/s4.4×3.4× more mail per second on the same hardware
Inbound p506.19 s1.35 s4.6×New mail arrives near-instantly
Submission throughput2.2 msg/s6.8 msg/s3.1×Bulk outbound queues drain comfortably
IMAP FETCH p5035.97 ms20.96 ms1.7×Snappier reads; long lists scroll smoothly
Queue delivery2.1 msg/s7.2 msg/s3.4×Fewer bounces and delayed deliveries
Enqueue→delivery p5035.6 s5.30 s6.7×Nearly seven times faster end-to-end delivery
Queue backlog122 msgs0 msgszeroZero backlog under load
Idle memory~162 MiB~6.4 MiB1/25Runs comfortably on small hosts
Load memory~270 MiB~73 MiB1/3.7Memory stays flat through mail floods

Architecture

Protocol layer

SMTP :1025Submission :1587IMAP :1143ManageSieve :11490

Processing layer

Spam filtering (Rspamd)DKIM signingSieve filteringQueue management

Storage layer

TiDBPebbleLocal FSS3/MinIO

Quick Start

# Standalone dev mode
export MAILEZINE_DIRECTORY_FILE="internal/directory/testdata/dev-directory.json"
export MAILEZINE_AUTH_DEV_FILE="internal/auth/testdata/dev-passwords.json"

# Start the engine
go run ./cmd/mailezine

# Verify
curl http://127.0.0.1:11480/health

# End-to-end tests
go test ./cmd/mailezine -run TestEndToEnd -v

Storage Backend Comparison

TiDB

Distributed KV, the Enterprise default backend

  • MySQL protocol compatible
  • Multi-replica high availability
  • Capacity and throughput scale horizontally
  • One-way migration from traditional Maildir supported

Pebble

Pure-Go LSM KV, Community / local-dev default

  • Pure-Go implementation, no CGO dependency
  • Cross-platform support
  • Lightweight, zero external dependencies
  • Ideal for small and mid-size deployments

S3 object storage

Blob layer for message bodies

  • Bodies stored as blobs, metadata in KV
  • Local FS, MinIO or any S3-compatible service
  • Elastic storage that grows with your data
  • Suitable for large-scale deployments

The engine behind mailez

Mailezine powers every mailez edition, with the full SMTP / IMAP / POP3 / ManageSieve pipeline verified across two counter-balanced benchmark rounds. Community and Enterprise run the same engine — single-node and free, or distributed with enterprise features, with a smooth upgrade in between.