[Rspamd-Users] Whitelist ip range except for one ip

Alexander Moisseev moiseev at mezonplus.ru
Wed Oct 4 08:40:19 UTC 2023


On 04.10.2023 10:48, Henrik Rasmussen wrote:
> Great, thanks.
> 
> I would imagine something like
> 
> IP_WHITELIST {
>      type = "ip";
>      prefilter = "true";
>      map = "${CONFDIR}/ip_whitelist.map";
>      action = "accept";
> 
> IP_WHITELIST_EXCLUDE {
>      type = "ip";
>      map = "${CONFDIR}/ip_whitelist_exclude.map";
>      score = 0;
>      action = "?????";
>      description = "Sender's IP is excluded from being whitelisted by IP or ASN local whitelists";
> 
> But what action should I use? To be clear I would like to whitelist a whole range, but I do NOT want to blacklist the single IP in question; thus this IP should be handled as normal by rspamd.
> 

IP_WHITELIST {
     type = "ip";
     prefilter = "true";
     map = "${CONFDIR}/ip_whitelist.map";
     action = "accept";
     require_symbols = "!IP_WHITELIST_EXCLUDE";

IP_WHITELIST_EXCLUDE {
     type = "ip";
     map = "${CONFDIR}/ip_whitelist_exclude.map";
     score = 0;
     description = "Sender's IP is excluded from being whitelisted by IP or ASN local whitelists";

Though I'm not sure if it can work in prefilter.


More information about the Users mailing list