SpamAssassin and Rspamd both score incoming mail against rules and reject or tag messages above a threshold. SpamAssassin is the long-established Perl engine, run as the spamd daemon behind a filter such as spamass-milter. Rspamd is a newer C engine with a built-in web interface, a fast Redis-backed learning system and a milter protocol that Postfix talks to directly. For a new server in 2026, Rspamd is usually the better default, and SpamAssassin remains a solid choice where it is already deployed.
This guide compares the two, shows how each plugs into Postfix, and covers the tuning that matters in production.
Both tools run a message through many tests (header checks, SPF, DKIM, DMARC results, blocklist lookups, body patterns, a Bayesian classifier) and add up a score. The sum is compared with thresholds:
| Score | Typical action |
|---|---|
| Below the tag level | Deliver normally |
| Above the add-header level | Deliver with a spam header or move to the Junk folder |
| Above the reject level | Reject during the SMTP conversation |
Rejecting during the SMTP conversation is better than accepting and discarding: the sending server sees a clear 5xx and generates the bounce, instead of your server sending backscatter to a forged sender.
| Aspect | SpamAssassin | Rspamd |
|---|---|---|
| Language | Perl | C, with Lua rules |
| Speed | Slower, process per scan | Event driven, much higher throughput |
| Postfix integration | Milter such as spamass-milter, or a content filter | Native milter protocol |
| Learning | Bayes in a database file | Bayes and fuzzy hashes in Redis |
| Web UI | None built in | Built-in controller web interface |
| DKIM signing | Not included | Built-in module |
| Rule updates | sa-update | Updated with the package, plus custom maps |
Rspamd also does DKIM signing, DMARC checks, rate limiting and greylisting in the same process, which reduces the number of moving parts on a small server.
Install the packages for your distribution (on Debian or Ubuntu, rspamd and redis-server), then set a controller password and enable the milter in Postfix.
Put the hash into /etc/rspamd/local.d/worker-controller.inc:
Rspamd's proxy worker listens on port 11332 in milter mode. Tell Postfix to use it in main.cf:
milter_default_action = accept means mail is still delivered if Rspamd is down. Choose tempfail instead if you would rather defer mail than let spam through during an outage. Reload and check that it works:
Override defaults in /etc/rspamd/local.d/actions.conf, never in the packaged files, because package upgrades replace those:
Start conservatively: keep the defaults for a week, read the history in the web interface, and only then lower the numbers.
SpamAssassin runs as spamd. The common route is a milter:
Then in main.cf:
Scoring is configured in /etc/spamassassin/local.cf:
Update the rules regularly with sa-update, which Debian and Ubuntu run daily through a timer. Socket paths and package names differ between distributions, so check the documentation for yours.
Bayes is the single biggest accuracy gain you control. It needs real examples of spam and ham from your own users.
Both tools need a few hundred examples of each class before Bayes is active (Rspamd's default minimum is 200 per class). Automate training from the IMAP side: Dovecot's imapsieve plugin can run a script whenever a user moves a message in or out of the Junk folder, so users train the filter just by using their mail client.
rspamc history for legitimate mail that scored high and look at the symbols that fired.reject_unknown_reverse_client_hostname and reject_rbl_client for cheap early rejections.You can, but it is rarely worth it. Both do overlapping work and scores become hard to reason about. Pick one.
Rspamd's greylisting is optional and applies only to messages that already look suspicious. On many servers the scoring is enough, and greylisting mostly delays legitimate mail.
With milter_default_action = accept, Postfix delivers unscanned mail. With tempfail, it asks the sender to retry later. Pick based on whether you fear spam or delay more.
It needs Redis, but configuration is cleaner because of the local.d and override.d directories. Most small servers find it simpler overall.
Both filters score messages and act on thresholds. Rspamd is faster, includes DKIM signing and a web interface, and talks to Postfix as a milter, so it is the usual choice for new servers. SpamAssassin works well through spamass-milter. Whichever you use, keep local settings out of package files, train Bayes with real Junk and Inbox mail, and reject at SMTP time instead of discarding after acceptance.