Adding DNSBL / RBL to Postfix

Adding DNSBL to Postfix can be a great advantage as these services will help you defend against email spam. What these services does, is to provide a realtime database over IP addresses that are sending spam. If Postfix gets a positive result looking at a certain IP address, it will reject that mail.

Installation

OS: Ubuntu/Debian

Installation is simple, you just need to edit the main.cf file of Postfix.

nano /etc/postfix/main.cf

Edit the line starting with

smtpd_recipient_restrictions = ...

In the end of that line before “permit” insert content like this

, reject_rbl_client cbl.abuseat.org, reject_rbl_client bl.spamcop.net, reject_rbl_client zen.spamhaus.org

Reload Postfix to load the new rules

/etc/init.d/postfix reload

You can specify as many DNSBL servers you like.