External subnet block lists in CIDR notation

Request and discuss new features you would like to have.
Post Reply
User avatar
BOOZy
Posts: 39
Joined: 04 Oct 2017 13:17

External subnet block lists in CIDR notation

Post by BOOZy »

It'd be nice if there was an option to use block lists like the Spamhaus drop and edrop lists.

https://www.spamhaus.org/drop/
https://www.spamhaus.org/drop/drop.txt

This would also allow me to dynamically block IPs from a list generated by a different application in my network.
freyuh
Posts: 62
Joined: 04 Oct 2018 11:21

Re: External subnet block lists in CIDR notation

Post by freyuh »

How about using a cidr table for this: http://www.postfix.org/cidr_table.5.html

So downloading the drop list daily by cron and converting it to a cidr list.
This shouldn't be to complicated ...


Ulrich.
freyuh
Posts: 62
Joined: 04 Oct 2018 11:21

Re: External subnet block lists in CIDR notation

Post by freyuh »

wget http://www.spamhaus.org/drop/drop.txt
wget http://www.spamhaus.org/drop/dropv6.txt
wget http://www.spamhaus.org/drop/edrop.txt

cat drop.txt | sed -e 's/;.*//' | grep -v '^ *$' | ( while read OneAddr ; do echo "$OneAddr reject" ; done ) > Spamhaus_drop.cidr
cat dropv6.txt | sed -e 's/;.*//' | grep -v '^ *$' | ( while read OneAddr ; do echo "$OneAddr reject" ; done ) > Spamhaus_dropv6.cidr
cat edrop.txt | sed -e 's/;.*//' | grep -v '^ *$' | ( while read OneAddr ; do echo "$OneAddr reject" ; done ) > Spamhaus_edrop.cidr
Post Reply