[Mimedefang] Blacklist_to or spam trap?

Stefano McGhee SMcGhee at ARCweb.com
Fri Jan 17 08:26:01 EST 2003


Hello again,
	Tried this out last night.  Interesting results.  I found that
while I was lining up RCPT TO: addresses, it rejected the one I listed in
the @TrapAddr array (example below) but kept the one to my own address.
This basically functioned the same as putting a To:user1 at mydomain.com
REJECT in my access DB file.  What I'm trying to do is reject the entire
message including the copy for legitimate recipients if a FormerEmployee is
detected as a RCPT to (the trend is that the message is spam).  It seems
that the solution posted by Rob MacGregor to use SpamAssassin would be the
one to go with.  Is there something I might have done wrong with
filter_recipient that would cause this behavior?  Any other thoughts?

Cheers,

Stefano

# Check for various recipients that need filtering out
sub filter_recipient {
        my($recipient, $sender, $ip, $hostname, $first, $helo) = @_;
        my @TrapAddr = qw(user1 user2 user3 user4 user5);
        foreach $baduser (@TrapAddr) {
                if ($recipient =~ /^<?$baduser\@/){
                        return ('REJECT', "Invalid envelope recipient");
                }
        }
        return ('CONTINUE', "OK");
}




More information about the MIMEDefang mailing list