Using DNS Blackhole Lists (DNSBL) to block Incoming IP Addresses

Analysis of my mail server logs over the last few months shows that over 90% of SMTP Auth and dictionary attacks are coming from IP Addresses listed on Spamhaus and Spamcop DNS blackhole lists.

I initially wrote a Fail2ban Jail which did a DNS lookup of the incoming SMTP IP addresses at and which added firewall rules to the mail server to drop any further packets reaching the mail server from listed addresses.
This proved to be very effective and stopped SMTP Auth attacks and dictionary attacks from reaching the server.

With this success I looked at using DNSBL lookups on the IPFire firewall and have written this add-on

For more information check out the README at

Comments appreciated.