Netscape Messaging Server 4's SMTP daemon provides an API for protocol-level plugins that can affect the behaviour of the server during SMTP conversation. The sample antirelay.c plugin provides basic anti-relay facilities and is a satisfactory means for blocking relaying. On his web page, Yusuf Kursat Tuncel has published a modified version of that plugin that adds support for checking connecting client IPs in RBLs (Realtime Blackhole Listings). RBLs provide an effective method for blocking unsolicited bulk mail messages (commonly referred to as SPAM).
However, I've had no luck trying to use Yusuf's modified antirelay plugin - the SMTP server would quit on startup when trying to load the compiled plugin. Rather than correcting the source code of the plugin, I've decided to cook a more versatile solution myself using Dan J. Bernstein's rblsmtpd wrapper, NetCat and Perl.
In order to get a decent RBL functionality with Netscape Messaging Server 4 you'll have to:
My example script (see next section) connects to port 2500 through the loopback interface.
You should be now able to connect to your mailserver and negotiate with it using SMTP - in fact you're talking to NMS through rblsmtpd, my Perl script and Netcat.
Try to connect to the server with a source address of 127.0.0.2 (nc -s 127.0.0.2) - it's a special source address for testing RBL-enabled servers. Instead of your mail server's banner you should see rblsmtpd's banner, and you will be rejected after you supply "MAIL FROM:" and "RCPT TO:". This is what a known spammer's server would see.
RBL is an extremely effective method of blocking spam - after its introduction on our mail server the amount of spam was reduced by over an order of magnitude. Some individuals who received ~ 40 unsolicited messages a day now only receive ~ 1 a day.
Of course, this doesn't come without a price. Occasionally, a business partner's or potential customer's mail server gets listed on a RBL due to a misconfiguration of that server (usually an open relay, in some cases even used historically by the spammers to send spam through it, which fact is usually documented at Spamcop). We counter that by constantly monitoring rblsmtpd's logs with a script which extracts IPs, reverse resolves them to get domain names, highlights possible legitimate hosts (those in .pl domain) and sends the list of blocked servers to all co-admins who then