t***@gmail.com
2020-03-15 10:45:47 UTC
Hadn't found any quick-wins in respect to locating a pre-rolled solution to dynamically generate blacklists in Postfix. So I scripted 16 lines of bash which captures IPs from /var/log/maillog and pre-pends the IPs with "REJECT" after each. Net result is a rolling block list created every 90 seconds.
Anyhoo, the full script can be cloned from Github which automagically configures a SystemD Service & Timer to continuously execute the auto blacklist script. Tested and known to work correctly on RHEL 8 with Postfix 3.3.1, but should work on any combination of Linux & Postfix:
https://github.com/f1linux/postfix-autoBlacklisting
Should be very tweakable to other use-cases banning bad behaviour on a Postfix server. Figured it was worth sharing to save folks the effort of solving the same problem. -Terrence
Anyhoo, the full script can be cloned from Github which automagically configures a SystemD Service & Timer to continuously execute the auto blacklist script. Tested and known to work correctly on RHEL 8 with Postfix 3.3.1, but should work on any combination of Linux & Postfix:
https://github.com/f1linux/postfix-autoBlacklisting
Should be very tweakable to other use-cases banning bad behaviour on a Postfix server. Figured it was worth sharing to save folks the effort of solving the same problem. -Terrence