[Rspamd-Users] Map rcpt and from in single map

George Asenov george.asenov at wpx.net
Fri Mar 15 13:33:50 UTC 2024


Thanks Gerald;

This multimap type=selector looks like should do exactly what I want but 
can't get it to work.

/etc/rspamd/local.d/multimap.conf

whitelist_rcpt_from {
   type = "selector";
   selector = 'from.lower;rcpts.lower';
   symbol = "TEST_RCPT_FROM_WHITE";
   map = "/var/lib/rspamd/whitelits_rcpt_from.map";
   description = "whitelist rcpt_mail:from combination";
   #score = -10.0;
   action = "reject";
}


/var/lib/rspamd/whitelits_rcpt_from.map
from-mail at domain.com:to-mail at otherdomain.tld
from-mail at domain.com,to-mail at otherdomain.tld



the comma delimited entry is here because when I test with the received 
test email in test selectors UI I get the output with comma


But the symbol is not in the headers list. Also when scan the source the 
SYMBOL is not listed there.

There are other multimap rules in this file which are working properly 
but not this one.

Tested with the score setting and also with the action - same result.

What I miss?


On 14-Mar-24 12:32 AM, Gerald Galster wrote:
>> How create map to achieve the result of this rule but for multiple pairs:
>>
>> creative_blacklist_name_one {
>>         priority = high;
>>         from = "@example.com";
>>         rcpt = "@example.net";
>>         apply "default" {
>>             R_DUMMY = 100.0;
>>
>> but for "from" and "rcpt" values to use single map:
>> key=rcpt and value=from or the opposite.
>>
>> I want to create personal whitelist
>> whitelist from X for user Y without the need to edit files and use maps instead.
> 
> Just a guess: a multimap, type = "selector", using a combined from/to selector.
> 
> https://rspamd.com/doc/modules/multimap.html#map-types
> https://rspamd.com/doc/configuration/selectors.html#selectors-combinations
> 
> Or maybe extend some lua code. This checks if a map contains "from":
> https://rspamd.com/doc/lua/rspamd_map.html
> 
> https://rspamd.com/doc/lua/rspamd_task.html#mc5168
> 
> Best regards,
> Gerald

-- 
Warm regards
George A.
WPXHosting


More information about the Users mailing list