[Mimedefang] Blacklist_to or spam trap?

David F. Skoll dfs at roaringpenguin.com
Fri Jan 17 08:31:01 EST 2003


On Fri, 17 Jan 2003, Stefano McGhee wrote:

> 	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?

You cannot do this from filter_recipient.  You need to do it from
filter_begin, because filter_recipient can (as you noticed) only reject
a particular recipient, not the whole message.

How about:

sub filter_begin {
    my($recip);
    foreach $recip (@Recipients) {
	if (is_former_employee($recip)) {
	    action_bounce("$recip doesn't live here any more");
	    return;
        }
    }
}

That's way faster than running SpamAssassin.

I leave it to you to write the is_former_employee function.

--
David.



More information about the MIMEDefang mailing list