[Rspamd-Users] multimap rule priority

d tbsky tbskyd at gmail.com
Tue Mar 22 08:24:29 UTC 2022


Alexander Moisseev via Users <users at lists.rspamd.com>
>
> On 16.03.2022 19:41, d tbsky wrote:
> > Hi:
> >      I try to use multimap to setup some white-list and black-list.  I
> > want to use pre-filter mode so I can define "action accept"  for my
> > white-list and "action reject" for my black-list. but I found there is
> > situations which apply to both rules. can I make sure which rule has
> > higher priority? can I use "weight" at the symbol or some kind of
> > method?
> >
> >       thanks a lot for your help.
>
> You can use conditional maps[1].
>
> SYMBOL_BLACK {
>      require_symbols = "!SYMBOL_WHITE";
>      ...

I set up the rules and finally found that conditional maps is not
working under prefilter mode.
rspamd will pickup the rule randomly.
I don't know if this is a feature or bug?
is conditional maps supposed to work under perfileter mode?
I shrink my rules as below:

 LOCAL_BL_FROM { type = "from"; map =
"/etc/rspamd/local.d/bl_from.map"; description = "Local from
blacklist"; prefilter = true; action = reject; require_symbols =
 "!LOCAL_WL_IP";}
LOCAL_WL_IP { type = "ip"; map = "/etc/rspamd/local.d/wl_ip.map";
description = "Local ip whitelist"; prefilter = true; action =
accept;}

"bl_from.map" content => me at example.com
"wl_ip.map" content => 127.0.0.0/8

my environment is RHEL8 with official
https://rspamd.com/rpm-stable/centos-8/x86_64/rspamd-3.1-1.x86_64.rpm
I try to send mail from webmail to myself (eg: from me at example.com to
me at example.com).

"systemctl restart rspamd" and then try to send webmail.

sometimes the blacklist wins, sometime the whitelist wins. it seems
random. the winner will last until next "systemctl restart rspamd" to
select the new winner.


More information about the Users mailing list