Itools - A Beginner's Guide Adding RBL Blocking To your Mail Server
by Terry Allen
There has been a lot of negative publicity about various RBLs (Realtime Block List or sometimes also known as Relay Black List) over the years & rightly so, but there are numerous RBLs which seem to be reliable & reputable at the same time. Mail server users can certainly decrease the amount of spamming servers & users who try to send mail to user's mailboxes on your server.
This guide covers the addition of adding RBL blocking to your iTools machine by simply adding a few lines to your Postfix configuration file. Adding RBL blocking to users running earlier than Mac OSX 10.3.x will need to either install Postfix or look for information on RBL blocking for Sendmail. Tenon's Post.Office user's are well catered for as the interface for Post.Office incorporates RBL blocking within the application.
Modifying the main configuration file for your mail server is not for the faint of heart, but it's really not that difficult, so the best policy is to make a backup, as described below.
You'll most certainly want to check out the myriad of RBLs around the Internet & select your own. For my own purposes, I have 4 configured on my server so that if one particular RBL has missed out, one of the remaining 3 will most likely have a spammer listed & thus they will be prevented from sending mail to your server.
Now here we're really looking at a first line of defense. I'm assuming that you have already been through the iTools settings & added the suitable IP addresses & other details to your iTools Postfix configuration & ensured that your setup isn't an open mail relay, so it's time to do some editing, so I hope you've brought your terminal with you.
Unlike Sendmail,the Postfix configuration file is relatively easy to understand & is well covered with notes throughout, similar to Apache, so navigate to the correct directory to find the Postfix file:
# cd /etc/postfix
The file we wish to add the RBL lines to is called main.cf, so you can open it straight up, or you can do the smart thing & quickly do a backup, which is always a good thing to do in case of accidents or something going haywire during your work here, remembering all the time that we are working with the 'brains' of Postfix & if you do something wrong, you'll have the backup file just in case. So, make a backup using this command.
#cp main.cf main.cf.backup
Do a quick directory listing to make sure that the backup has worked (enter ls at the command line to see for yourself)
Now we need to open up the file in a text editor (I quite like using the Pico text editor from the command line), so at the command line enter:
The text editor will open the file up for you & you can use the arrow keys to navigate your way around the file. You can also page up & down using the Control-V combination. The current section of the file we're looking for is the Junk Mail Controls. You can press Control-W which gives you a sort of 'find' function within Pico, or you can scroll down through the file, which is not a bad thing to do as you can see how Postfix works through the various controls & settings.
Once you find it, you'll see a marked off section like this:
Now for the easy bit - you need to add some lines to your file, so you can cut & paste these in (the lines which list each of the RBLs have a tab in front, but I don't think it will matter if there is only a single space):
maps_rbl_domains = sbl.spamhaus.org relays.ordb.org cbl.abuseat.org bl.spamcop.net smtpd_client_restrictions = reject_rbl_client sbl.spamhaus.org reject_rbl_client relays.ordb.org reject_rbl_client cbl.abuseat.org reject_rbl_client bl.spamcop.net
You can enter your own RBLs into the places I have listed above, or perhaps even add more, following the format as shown above.
Now, unbelievably, we're just about done, it's that simple, but you firstly need to save your modifications to the file, so press Control-X & follow the prompts to save it as the same name.
Ready to roll? Head into your iTools admin & restart you mail server or type postfix reload into the command line & you're away. Assuming your mail load is relatively high, it won't be too long & you'll start seeing lines like this one appear in your mail logs, showing you that the use of those RBLs is helping to stop spammers delivering more junk to your system's users:
reject: RCPT from unknown[18.104.22.168]: 554
Service unavailable; Client host [22.214.171.124] blocked using
from=<email@example.com> to=<firstname.lastname@example.org> proto=ESMTP
That of course, means that your mail server doesn't have to deal with what is most likely more spam coming through & you'll be much happier in that knowledge.