[Mimedefang] Block all spam from one user?

David F. Skoll dfs at roaringpenguin.com
Thu Nov 28 14:47:01 EST 2002


On Thu, 28 Nov 2002, Rick Mallett wrote:

> There are many ways to do it
> in Perl, but the most straightforward is probably

>   foreach $recipient (@Recipients) {
>     action_discard() if $recipient =~ /support\@mydomain.com/i;
>   }

this will ALSO discard mail to another recipient if it happened to be
addressed to both support and another recipient.  This may not be a problem,
but if it is, you'll want to put something like this in filter_begin:

foreach $recip (@Recipients) {
    $recip =~ tr/<>//d;  # Nuke angle brackets
    $recip = lc($recip); # Lower-case
    if ($recip eq 'support at mydomain.com') {
        if (stream_by_recipient()) {
            return;
        }
    }
}


stream_by_recipient() does some powerful magic; see mimedefang-filter(5).

--
David.



More information about the MIMEDefang mailing list