rspamd(8)
rspamd is a fast and modular spam filtering system that uses machine learning and rule-based detection to classify emails.
Synopsis
rspamd [OPTION]... [CONFIG_FILE]Description
rspamd is a high-performance spam filtering daemon written in C that uses Bayesian classification, fuzzy matching, and complex rule systems to detect spam and phishing emails. It integrates with mail servers via the RSPAMD protocol and provides real-time analysis with minimal latency.
The daemon loads configuration from /etc/rspamd/ and maintains learning databases for Bayesian spam/ham classification. It supports multiple backends (Redis, SQLite) for storing learned data and can be controlled via rspamdctl or HTTP API.
Common options
| Flag | What it does |
|---|---|
-h, --help | display help message and exit |
-v, --version | show version information |
-c, --config=FILE | load configuration from FILE instead of default |
-d, --daemonize | run as a background daemon |
-u, --user=USER | run daemon as specified user (default: _rspamd) |
-g, --group=GROUP | run daemon with specified group (default: _rspamd) |
-p, --pidfile=FILE | write process ID to FILE |
-f, --foreground | run in foreground (don't daemonize) |
--compress | enable compression in protocol |
-t, --test-config | test configuration and exit without running |
Examples
Start rspamd daemon in background with custom config file
rspamd -d -c /etc/rspamd/rspamd.confValidate the configuration syntax without starting the daemon
rspamd -t -c /etc/rspamd/rspamd.confFeed an email to rspamd for spam learning
rspamdctl learn_spam < spam_email.emlDisplay current rspamd statistics and performance metrics
rspamdctl statRun rspamd in foreground as rspamd user and group (useful for debugging)
rspamd -f -u rspamd -g rspamdManually submit an email to rspamd HTTP API for scanning
curl -X POST --data-binary @email.eml http://localhost:11333/checkRestart rspamd service and watch the log output
systemctl restart rspamd && tail -f /var/log/rspamd/rspamd.logShow statistics about fuzzy hashes used for spam detection
rspamdctl fuzzy_stat