[Rspamd-Users] Combined Multimap Regexp not working
Benjamin Weik
Benjamin.Weik at core-backbone.com
Wed Sep 21 14:11:03 UTC 2022
I'm trying to write a multimap rule to filter out a combination of sender & receiver email addresses.
Like we're getting a lot of spam from emails like marketing1 at domain.tld or like any combination of marketing.*@.* to a specific email address which distributes company wide.
So I made a combined rule which works as long as I enter the full address into the map. If I try wildcards or regex, it's not matching and I cannot figure out why.
Here is the rule:
COMBINED_MAP_AND {
type = "combined";
prefilter = true;
action = reject;
score = 9;
regexp = true;
rules {
sender = {
map = "$LOCAL_CONFDIR/local.d/combined_email_blacklist_sender.map";
selector = "from:addr.lower";
regexp = true;
}
receiver = {
map = "$LOCAL_CONFDIR/local.d/combined_email_blacklist_receiver.map";
selector = "rcpts:addr.lower";
}
}
expression = "sender & receiver"
}
And in the sender map I tried various stuff:
/marketing.*/gi
marketing.*
regexp:/marketing/gi
marketing at example.com
I've also tried adding :regexp to the selector to no avail.
How can I achieve regex functionality in the rule?
BR,
Benjamin
More information about the Users
mailing list