How can I use a blocklist to reduce spam?

If I want to use a blocklist, like Spamhaus, what do I need to do? Is there an extra module that needs installing or is it something within an existing configuration file?

I’m using Postfix and Webmin/ Virtualmin GPL.


You can add those by editing the Postfix configuration.

If you edit your /etc/postfix/ file, look for the line beginning with “smtpd_recipient_restrictions”, and add your desired RBL’s to the end of that line.

For example, in the case of Spamhaus, you could add this to the end of that line:


And then restart Postfix after you’ve added that.


In addition to Eric’s solution, you might want to make sure that before the “reject_rbl_client” statement you have this in the corresponding line:


That will allow authenticated users to send mail, no matter if their IP address might be blacklisted by the RBL. (Postfix honors the statements in that config line sequentially, so authenticated users take precedence over RBL here.) Failing to do so might annoy your users, if they can’t send email cause they happen to have been assigned a dynamic IP that happens to be blacklisted. :slight_smile:

Excellent… A refreshingly simple way to get it implemented - thanks!