[Rspamd-Users] whitelisting before blacklisting

Albrecht Backhaus albrecht.backhaus at gmail.com
Sun Jan 12 21:54:07 UTC 2020


Am 12.01.2020 18:56:30, "Max Grobecker" 
<max.grobecker at ml.grobecker.info> schrieb:

>Hi Albert,
>
>
>>  it does not work. The mails are matched first by the blacklist filter and will then be rejected.
>>
>>  Is there any way to get the white-listing handled first ?
>
>You could add a condition to the blacklist rules to not match if there is a whitelist symbol.
>
>For example:
>
>-----------------------------------------------------------------
>
>sender_from_blacklisted_domain {
>
>             require_symbols = "!SENDER_FROM_WHITELISTED_DOMAIN & !SENDER_FROM_WHITELISTED_TLD & !SENDER_FROM_WHITELISTED_ADDR"
>
>             type = "header";
>             header  = "from";
>             filter = "email:domain";
>             map = "file:///etc/rspamd/local.d/maps.d/blacklist_from_domain.map";
>             regexp = true;
>             symbol = "SENDER_FROM_BLACKLISTED_DOMAIN";
>             action = "reject"; # Prefilter mode
>}
>
>--> https://rspamd.com/doc/modules/multimap.html#conditional-maps
>
>-----------------------------------------------------------------
>
>This would make this rule only match if no whitelist rule matched the same time.
>AFAIK all rules are processed but only one of them takes precedence in the end.
>
>
>For black- and whitelisting on my system, I just set the symbols but do not define any actions.
>These are defined with the ForceActions module where I can have those expressions like "require_symbols" but I only need them in one place ;-)
>Maybe, if the above does not work, this could be the best way to do this.
>
>
>
>Greetings from Wuppertal
>  Max


Thanks, but the condition does not work in prefilter mode according to 
doc.

Gave also the force_actions a try - so far not succesfull ....

Greetings  from Basel
Albrecht


More information about the Users mailing list