[Mimedefang] Modify SA score if to many unknown users
Stefano McGhee
SMcGhee at ARCweb.com
Mon Sep 22 09:36:01 EDT 2003
Hello,
I asked this question awhile back. At first, I was going to make a
custom SA rule for this, but then, after some help from you generous list
users, I came up with the following code. Basically, the code rejects any
message that contains an address that I specify to be long dead. The
addresses only get spam these days and anyone in the message with them is
sure to get spam as well so I bounce the *entire* message for *all*
recipients. It you want to use SA, make a rule for each gone address, but
this code foregoes SA and saves CPU cycles. Notice that if you use
stream_by_recipient, this goes BEFORE it.
Cheers,
Stefano
sub filter_begin () {
# Check for various recipients that need filtering out
my @TrapAddr = qw(user1 user2 user3);
my ($recip, $baduser);
foreach $recip (@Recipients) {
foreach $baduser (@TrapAddr) {
if ($recip =~ /^<?$baduser\@/i){
md_log('spam', "Message sent to $baduser dropped");
return action_bounce("Invalid envelope recipient");
}
}
}
# This line causes all messages literally sent to more than one person
# to be broken up and sent individually. This allows for better per
# person behavior by SpamAssassin
if (stream_by_recipient()) {
return;
}
Filter_begin continues on........
> Many spamers use CC function, so it's simply 1 spam mail with
> 15 - sometimes
> up to 30 recipients. Some of the recipient addresses exist
> (user recieves the
> spam...) some not.
>
More information about the MIMEDefang
mailing list