Fast and efficient
Optimized for high-speed email processing with a lean, async core.
Open-source SMTP relay
Hedwig is a high-performance, minimalist SMTP server implemented in Rust. It receives, queues, and forwards email to destination SMTP servers using a durable on-disk queue and a straightforward configuration.
Core capabilities
Optimized for high-speed email processing with a lean, async core.
Focuses on core SMTP relay flows without unnecessary complexity.
Emails are queued on the filesystem for durable processing.
Specializes in receiving and forwarding, not full server semantics.
Supports DKIM, TLS, and SMTP authentication with practical defaults.
Per-domain rate limiting keeps outbound delivery healthy.
Architecture snapshot
Plaintext or TLS listeners accept mail and negotiate SMTP.
Authentication, domain filtering, and rate limiting are enforced.
Messages land in a persistent on-disk queue for durability.
Workers parse, sign with DKIM, and resolve MX records.
Outbound pools relay to destination servers with retries.
Quickstart
git clone https://github.com/iamd3vil/hedwig.git
cd hedwig
cargo build --release
HEDWIG_LOG_LEVEL=info ./target/release/hedwig
Set up listeners, optional TLS, and storage paths in a single TOML file.
Open the full guideConfiguration
[server]
workers = 4
max_retries = 5
pool_size = 100
[[server.listeners]]
addr = "0.0.0.0:25"
[[server.listeners]]
addr = "0.0.0.0:465"
[server.listeners.tls]
cert_path = "/path/to/cert.pem"
key_path = "/path/to/key.pem"
[storage]
storage_type = "fs"
base_path = "/var/lib/hedwig/mail"
Optional auth, rate limiting, metrics, and health checks live here.
Open configuration docsMetrics (optional)
Track queued, deferred, bounced, and dropped messages.
Monitor per-domain successes, failures, and latency.
Measure job processing time and DKIM signing latency.