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.
Here's my short HOWTO on setting up RBL with Netscape Messaging Server 4 using Dan J. Bernstein's rblsmtpd wrapper, NetCat and Perl.