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 rspamdStep 2: Configure Postfix Integration
Tell Postfix to use Rspamd as a milter:
sudo nano /etc/postfix/main.cfmilter_protocol = 6
milter_default_action = accept
smtpd_milters = inet:localhost:11332
non_smtpd_milters = inet:localhost:11332Step 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.keyCreate the DKIM signing configuration:
sudo nano /etc/rspamd/local.d/dkim_signing.confpath = "/var/lib/rspamd/dkim/$domain.$selector.key";
selector = "mail";Step 4: Set Up the Web Interface
sudo nano /etc/rspamd/local.d/worker-controller.incpassword = "$2$secretpasswordhash";Generate the password hash with:
rspamadm pwStep 5: Restart Services
sudo systemctl restart rspamd postfixAccess 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