[Rspamd-Users] Map of IPs in CIDR notation but with exceptions?

Alexander Moisseev moiseev at mezonplus.ru
Sat Apr 20 21:12:51 UTC 2024


On 20.04.2024 22:23, Michael Grimm via Users wrote:
> Hi,
> 
> I wonder if there is a way to define a map of IPs like:
> 
> All 10.1.1.0/24 but not 10.1.1.222?
> 
> Tests like …
> 
> 	10.1.1.0/24,!10.1.1.222
> 	10.1.1.0/24,-10.1.1.222
> 
> … failed with "invalid IP address: !10.1.1.222" and "invalid IP address: -10.1.1.222"
> 
> Is there a way to achieve this?
> 

You can use conditional maps: https://rspamd.com/doc/modules/multimap.html#conditional-maps
Example: https://github.com/moisseev/rspamd-multimap-bl/blob/9608a091b9f4ad9f353ee8f061ea0fd43e6685ba/local.d/multimap.conf#L9



More information about the Users mailing list