I've modified the source code of Netscape-supplied antirelay.c plugin for Netscape Messaging Server 4.15 so that it grants relaying based on whether the sender e-mail address is in the delivery domain (in addition to original recipient e-mail address and hosts-based submission control).
More details here [1].
Here's my short HOWTO [2] on setting up RBL with Netscape Messaging Server 4 using Dan J. Bernstein [3]'s rblsmtpd [4] wrapper, NetCat [5] and Perl [6].
Links:
[1] http://olo.org.pl/dr/adminstuff/netscape_messaging/relayfrom
[2] http://olo.org.pl/dr/adminstuff/netscape_messaging/rbl
[3] http://cr.yp.to/
[4] http://cr.yp.to/ucspi-tcp/rblsmtpd.html
[5] http://www.atstake.com/research/tools/network_utilities/
[6] http://www.perl.org/