Bypassing Rspamd for specific emails, domains, or users requires configuring whitelisting rules and scoring adjustments in Rspamd’s configuration files. Here’s a step-by-step guide to configuring a bypass in Rspamd:
Step 1: Access the Rspamd Configuration Directory
- Connect to your server via SSH:
sh
CopyEdit
ssh user@yourserver
2. Navigate to the Rspamd configuration directory:
sh
CopyEdit
cd /etc/rspamd/
Step 2: Whitelist an Email or Domain
To bypass Rspamd filtering for specific senders or domains:
- Open the whitelist configuration file (create if it doesn’t exist):
sh
CopyEdit
sudo nano /etc/rspamd/local.d/whitelist_sender.map
2. Add the emails or domains you want to bypass (one per line):
pgsql
CopyEdit
user@example.com
@trusted-domain.com
3. Save and exit (CTRL + X, then Y, then Enter).
4. Now, link this whitelist to Rspamd filtering:
sh
CopyEdit
sudo nano /etc/rspamd/local.d/settings.conf
5. Add the following configuration:
yaml
CopyEdit
whitelist {
priority = “high”;
from = “/etc/rspamd/local.d/whitelist_sender.map”;
apply {
symbols_disabled = [“ALL”];
groups_disabled = [“antivirus”, “antiphishing”, “antispam”];
}
}
6. Save and exit.
Step 3: Disable Scoring for Whitelisted Senders
If you want to ensure that whitelisted senders have zero spam score:
- Edit the scores configuration file:
sh
CopyEdit
sudo nano /etc/rspamd/local.d/metrics.conf
2. Add:
yaml
CopyEdit
whitelist {
id = “whitelist”;
score = -100;
description = “Whitelisted sender, bypass Rspamd checks”;
}
3. Save and exit.
Step 4: Restart Rspamd
After making changes, restart Rspamd to apply them:
sh
CopyEdit
sudo systemctl restart rspamd
Step 5: Verify the Configuration
To check if the bypass is working:
sh
CopyEdit
rspamc symbols test-email@example.com
- If the whitelisted sender is working, the spam score should be low or zero.