[Rspamd-Users] Dependent Maps and RegExp

Kai Bojens kb at artfiles.de
Mon Sep 25 09:28:54 UTC 2023


Time appropiate greetings.

I have a dependent map which selects the HASHKEY in Redis depending on 
the recipient, so that I'm able to implement per user whitelists.

SENDER_FROM_WHITELIST_RCPT {
           type = "from";
           filter = "email:addr"
           map = "redis+selector://to.lower";
           symbol = "SENDER_FROM_WHITELIST_RCPT";
           require_symbols = "R_SPF_ALLOW";
           prefilter = true;
           action = "accept";
           regexp = true;
}

This works fine for email addressses:

127.0.0.1:6379> HGETALL bar at foo.tld
  1) "foo at bar.tld"
  2) "1"

It works as intended:

forced: no action "Matched map: SENDER_FROM_WHITELIST_RCPT"

But this only works for complete email addresses and not for Regular 
Expressions despite what's written in the documentation for Multimaps:

"All maps, except for ip and dnsbl maps, support the regexp mode."

127.0.0.1:6379> HGETALL bar at foo.tld
  1) "/.*bar\\.tld"
  2) "1"
  3) "/.+bar.tld/i"
  4) "1"
  5) "/.*@bar.tld/i"
  6) "1"
  7) "/.*@bar\\.tld"
  8) "1"
  9) "/.*@bar\\.tld/i"
10) "1"

The log still shows no matches: "err=nil, data=".

Any suggestions or ideas?


More information about the Users mailing list