Rspamd Configuration Guide
This page links the guides and reference pages for configuring Rspamd. The guides explain what to configure and which file each change goes in; the reference pages describe the options of one area in detail. If Rspamd is not installed yet, start with installation and first setup.
How the Configuration Is Layered
Rspamd filters spam with its shipped configuration, so you only add the settings you want to change. Don't edit the shipped files: upgrades bring new versions of them. Rspamd reads the configuration in layers, from lowest to highest precedence:
- Shipped defaults:
rspamd.confand the files next to it,modules.d/andscores.d/ local.d/: merged with the defaults, so a file holds only the settings you change- Scores and action thresholds saved from the web interface (
/var/lib/rspamd/rspamd_dynamic) override.d/: each key or block you define replaces the default as a whole
Precedence has examples. Change one thing at a time, check it with rspamadm configtest, and watch the results in the web interface before you make the next change.
Getting Started with Configuration
New to Rspamd Configuration?
- Configuration Fundamentals - What to configure and how
- Tool Selection Guide - Which mechanism to use for a custom check
- Common Setups - Which files a minimal, a tuned and a high-volume setup change
- Testing Changes - Check the configuration before you restart Rspamd
Specific Configuration Tasks?
- Spam Filtering Tuning - Adjust thresholds and scores
- Performance Tuning - Worker count, DNS and scan limits
- Custom Rules - Create rules for your specific needs
- Integration Configuration - Connect with MTAs and other systems
Configuration Areas
| Area | What it controls | Where you change it | Reference |
|---|---|---|---|
| Actions | What Rspamd tells the MTA to do at each score | local.d/actions.conf | Actions and scores |
| Scores | How much each symbol adds to the message score | local.d/groups.conf or local.d/<group>_group.conf, or the web interface | Actions and scores |
| Modules | Which checks run and how they are set up | local.d/<module>.conf | Modules |
| Workers | The processes that scan mail, serve the web interface and talk to the MTA | local.d/worker-<name>.inc | Workers |
| General options | DNS, timeouts, size limits | local.d/options.inc | Common options |
| Logging | Log level, destination and format | local.d/logging.inc | Logging |
| Redis | Servers for Bayes, greylisting, rate limiting and other modules that keep data in Redis | local.d/redis.conf | Redis configuration |
| Bayes | The statistical classifier | local.d/classifier-bayes.conf | Statistics |
Other reference pages:
- User settings: different scores, thresholds and checks for selected users, domains or IP addresses
- Composite symbols: new symbols from expressions over other symbols
- Maps: lists that Rspamd loads from files or URLs and reloads without a restart
- Selectors: extract data from messages for multimap, ratelimit and other modules
- Upstreams: server lists and how Rspamd picks a server from them
- UCL: the syntax of the configuration files
- Configuration templates: Jinja templates and environment variables in configuration files
Configuration by Scenario
Different environments have different needs. Find the guide that matches your situation:
By Use Case
- Migration from SpamAssassin - Migration path, rule conversion and rollout
- Per-Domain and Per-User Settings - Different thresholds and checks for different domains, users or senders
- Allow and Block Lists - Multimap rules for domains, IP addresses, headers, URLs and attachments
- Scanning Outbound Mail - How modules treat mail sent by your users, and how to control it
- DKIM Signing - Sign outgoing mail
By Integration Type
- Postfix Integration - Complete Postfix + Rspamd setup
- Other MTAs - Exim, Sendmail, Haraka, Stalwart and others
- Docker - The official image and a Compose file with Redis and a recursive resolver
- Kubernetes - Deployment example, probes, and what to run separately
- Alongside SpamAssassin - Run Rspamd next to SpamAssassin and compare results before Rspamd rejects anything
Configuration Best Practices
File Organization
/etc/rspamd/
├── local.d/ # Your customizations (recommended)
│ ├── actions.conf # Spam thresholds
│ ├── groups.conf # Symbol scores
│ └── worker-*.inc # Worker settings
├── override.d/ # Replaces defaults key by key (advanced)
└── modules.d/ # Don't edit - defaults only
On FreeBSD the directory is /usr/local/etc/rspamd/. A file in local.d/ contains only the settings you change, without the section name around them: local.d/actions.conf contains reject = 20;, not actions { reject = 20; }. Older guides set scores in local.d/metrics.conf; that file has been deprecated since Rspamd 1.7.
Change Management Process
- Backup current configuration before making changes
- Test syntax with
rspamadm configtestbefore restarting - Monitor results in web interface after changes
- Document changes for future reference
- Have rollback plan for critical changes
Common Mistakes to Avoid
- ❌ Editing the shipped files in
/etc/rspamd/instead of adding files tolocal.d/ - ❌ Making multiple changes without testing
- ❌ Setting unrealistic action thresholds
- ❌ Disabling essential modules without understanding impact
- ❌ Ignoring log files during troubleshooting
Configuration Tools and Interfaces
Web Interface (Recommended for Beginners)
- Access:
http://localhost:11334. The controller listens only on localhost by default, so from another machine use an SSH tunnel - Best for: Monitoring, basic adjustments, learning
- Limitations: It changes only symbol scores, action thresholds and maps; everything else needs the configuration files
Configuration Files (Advanced Users)
- Location:
/etc/rspamd/local.d/ - Best for: Complex customizations, automation
- Requirements: Understanding of Rspamd configuration syntax (UCL)
Command Line Tools
rspamc- Query statistics, test messagesrspamadm- Administrative tasks, configuration managementrspamadm configtest- Configuration validation
Getting Help with Configuration
Built-in Help
# Show the configuration as Rspamd loads it
rspamadm configdump
# Validate configuration files
sudo rspamadm configtest
# Describe a configuration option
rspamadm confighelp options.task_timeout
# List rspamadm commands, or show the options of one command
rspamadm help
rspamadm help configdump
Documentation Resources
- Configuration FAQ -
local.dandoverride.d, changing scores, disabling modules and rules - Module Documentation - Detailed module configuration
- Why Isn't My Configuration Working? - A section wrapper inside a
local.d/file - Common Issues - Connection refused, missing spam headers, too much or too little mail marked as spam
Community Support
- GitHub Issues - Report bugs and feature requests
- GitHub Discussions - Propose or discuss an idea
- Discord and Telegram - Quick questions and troubleshooting help
- Mailing Lists - Announcements and long-form threads
Support also describes commercial support.
Configuration Examples
Quick Start Configuration
The shipped configuration filters spam without changes. Its action thresholds are reject = 15, add_header = 6 and greylist = 4, so you don't need local.d/actions.conf to start. Add Redis, which Bayes, greylisting and rate limiting need, and a password for the web interface:
# /etc/rspamd/local.d/redis.conf
servers = "127.0.0.1";
# /etc/rspamd/local.d/worker-controller.inc
password = "$2$..."; # hash printed by rspamadm pw
Tuned Configuration
Lower action thresholds and a higher score for one symbol. Change values like these only after you have checked the results in the History tab of the web interface:
# /etc/rspamd/local.d/actions.conf
reject = 12; # default 15
add_header = 5; # default 6
greylist = 3; # default 4
# /etc/rspamd/local.d/groups.conf
symbols {
"FORGED_SENDER" {
weight = 1.0; # default 0.3
}
}
High-Volume Configuration
More scanner processes and a local recursive resolver:
# /etc/rspamd/local.d/worker-normal.inc
count = 8; # example value
# /etc/rspamd/local.d/options.inc
dns {
nameserver = ["127.0.0.1"]; # local recursive resolver
}
Leave max_tasks and the other dns options at their defaults. max_tasks caps how many messages one process handles at the same time; it does not increase throughput. See Normal worker for count and max_tasks, and Performance tuning for the DNS options.
What's Next?
Choose your path based on your current needs:
- Just getting started? → Configuration Fundamentals
- Need a custom check? → Tool Selection Guide
- Want to optimize performance? → Performance Tuning
- Ready for advanced features? → Writing Rules
Remember: Effective configuration is an iterative process. Start with the basics, monitor results, and refine based on your actual email patterns and business requirements.