What I wanted to do is allow mail to certain "critical"
addresses (e.g. postmaster, support, and abuse) even
if the sender is using an RBL-listed mail server.
Sendmail can do this, but then again, sendmail can
do anything....

As far as I can see, the stock rblsmtpd code cannot
do this, nor can Russ's patches to qmail-smtpd and
tcpserver.  I have hacked together something that can
do this, but it's kind of ugly -- I'm posting this,
hoping that some self-appointed "arbiter of style" will
suggest naming changes, rolling this into other features,
etc...

I have modified rblsmtpd to accept a new flag "-e"
(for "environment" or "exec-always").  When given
this flag, it will always exec its argument, but if
TCPREMOTEIP is blacklisted, it will set an environment
variable RESTRICT to the TXT record of the blacklist
response (i.e. its standard rejection message, more
or less).  If rblsmtpd is also given the "-b" (bounce)
option, it will prefix RESTRICT with a hyphen.

I have also modified qmail-smtpd, to look for a new
control file, "control/restrictrcpt," a list of
addresses (no wildcards [yet]).  If the RESTRICT
environment variable is set, qmail-smtp will only
accept mail for those addresses.  If the remote end
attempts an "rcpt" to an address which is not in
the list, qmail-smtpd rejects it with the text of
$RESTRICT (and a 553 prefix if $RESTRICT begins with
a '-', 451 otherwise).

I'd appreciate feedback, and will gladly post the
patches after incorporating any suggestions I receive.

-- 
Chris Mikkelson  |      Problems are posed by fools like me;
[EMAIL PROTECTED] |      But only Heuristics can search a tree.

Reply via email to