Docs / Email Servers / How to Configure Rspamd Spam Filter

How to Configure Rspamd Spam Filter

By Admin · Mar 1, 2026 · Updated Apr 23, 2026 · 27 views · 2 min read

What Is Rspamd?

Rspamd is a fast, advanced spam filtering system that uses multiple detection methods including Bayesian filtering, neural networks, fuzzy hashing, and DNS blocklists. It serves as a modern replacement for SpamAssassin with significantly better performance, making it ideal for a Breeze handling email traffic.

Prerequisites

  • A Breeze running Ubuntu 22.04+ with Postfix configured
  • Redis installed (used by Rspamd for caching and statistics)
  • Root or sudo access

Step 1: Install Rspamd

sudo apt install -y lsb-release wget gpg
wget -qO- https://rspamd.com/apt-stable/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/rspamd.gpg
echo "deb [signed-by=/etc/apt/keyrings/rspamd.gpg] https://rspamd.com/apt-stable/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/rspamd.list
sudo apt update
sudo apt install rspamd

Step 2: Configure Postfix Integration

Tell Postfix to use Rspamd as a milter:

sudo nano /etc/postfix/main.cf
milter_protocol = 6
milter_default_action = accept
smtpd_milters = inet:localhost:11332
non_smtpd_milters = inet:localhost:11332

Step 3: Enable DKIM Signing

sudo mkdir -p /var/lib/rspamd/dkim
sudo rspamadm dkim_keygen -s mail -d yourdomain.com -k /var/lib/rspamd/dkim/yourdomain.com.mail.key

Create the DKIM signing configuration:

sudo nano /etc/rspamd/local.d/dkim_signing.conf
path = "/var/lib/rspamd/dkim/$domain.$selector.key";
selector = "mail";

Step 4: Set Up the Web Interface

sudo nano /etc/rspamd/local.d/worker-controller.inc
password = "$2$secretpasswordhash";

Generate the password hash with:

rspamadm pw

Step 5: Restart Services

sudo systemctl restart rspamd postfix

Access the web UI at http://your-breeze-ip:11334.

Key Features

  • Greylisting, rate limiting, and phishing detection built in
  • Bayesian classifier learns from your mail patterns over time
  • Add the generated DKIM TXT record to your domain DNS

Was this article helpful?