My last answer does help quite a bit, but overall I have found some issues still unsolved:
for some reason it still adds ACCEPTLIST_SENDER_DOMAIN
for a domain I deleted a while ago from the map file. I even restarted rspamd multiple times, but it refuses to forget about that domain. And I can't find any cache that I could delete that would help.
Adding to this, the multimap is supposed to accept mails coming from specified domains no matter what. But only when the domain is in the From:
header, not in any other case. The domain I previously falsely added to the whitelist was the domain of our mailing list. So rspamd should never have accepted those mails in the first place based on the multimap, as no mailinglist of ours will replace the From:
header with its own address. But still, many spam mails get still marked as spam, even if in theory they should be excluded by the false ACCEPTLIST_SENDER_DOMAIN
. For now, I've re-added the prefilter=true
; to the multimap config, maybe this will help. But all in all, rspamd still doesn't behave as expected.
EDIT: to solve the first problem I've switched back to explicitly check the From:
header, as type:from will check the envelope from before checking this, so this should be much more reliable (of course it's quite simple to modify the From header but I can count the incidents this happened in the past years that haven't been caught by our main spam filter on one hand):
ACCEPTLIST_SENDER_DOMAIN {
type = "header";
header = "From:";
prefilter = true;
map = "/etc/rspamd/local.d/acceptlist.sender.domain.map";
symbol ="ACCEPTLIST_SENDER_DOMAIN";
description = "Sender domain is on allowed";
action = "accept"; # Prefilter mode
}
BLOCKLIST_SENDER_DOMAIN {
type = "header";
header = "From:";
prefilter = true;
map = "/etc/rspamd/local.d/blocklist.sender.domain.map";
symbol = "BLOCKLIST_SENDER_DOMAIN";
description = "Sender domain is on blocked";
action = "add_header"; # Prefilter mode
}
But for some reason mails have the following in their header once these symbols are triggered:
X-Rspamd-Pre-Result: action=no action;
module=multimap;
Matched map: ACCEPTLIST_SENDER_DOMAIN
Action in this case clearly should be "accept", as stated in the config. This is how it looks like in the config dump:
multimap {
ACCEPTLIST_SENDER_DOMAIN {
action = "accept";
map = "/etc/rspamd/local.d/acceptlist.sender.domain.map";
description = "Sender domain is on allowed";
symbol = "ACCEPTLIST_SENDER_DOMAIN";
prefilter = true;
type = "header";
header = "From";
}
BLOCKLIST_SENDER_DOMAIN {
action = "add_header";
map = "/etc/rspamd/local.d/blocklist.sender.domain.map";
description = "Sender domain is on blocked";
symbol = "BLOCKLIST_SENDER_DOMAIN";
prefilter = true;
type = "header";
header = "From";
}
[...]
}