Qmail RBL - How to whitelist IP address or class
If your internet provider set some stupid, paranoid email protocol policies which block external smtp usage you might be forced to use their smtp server to send email. Range of activities to prevent you from using external smtp can vary. Sometimes providers block port 25 and sometimes they list their own IP classes on spamhaus.org so if external smtp use RBL blocking it will filter out your IP.
If you have access to target smtpd you can easily whitelist internet provider IP classes so they wont be checked by RBL. My smrp server is standard Qmail installation (qmailrocks). All you need to do is to edit /etc/tcp.smtp and to add this instruction to your smtpd:
xxx.xxx.xxx.xxx:allow,RBLSMTPD=”"
Of course, you will have to replace xxx.xxx.xxx.xxx with your actual IP address, or you might whitelist whole IP classes by simply omiting adequate octets, for example:
xxx.xxx.xxx.:allow,RBLSMTPD=”"
for C class. At the same time you could backlist IP address by adding response to RBL. Put some comment in between quotation marks, for example:
xxx.xxx.xxx.xxx:allow,RBLSMTPD=”This is spam IP!”
I won’t dive into detailed explanations about inner RBL functioning which is out of scope of this text. It’s important to know that if you put anything between quotation marks in above RBL configuration instructions smtp will consider related IP address as spam.
Finally, you will have to stop Qmail and recompile tcp.smtp instructions file by issuing following commands:
qmailctl stop
qmailctl cdb
qmailctl start
Good luck!