[Mimedefang] SpamDrop

-ray ray at ops.selu.edu
Thu Jul 24 14:22:01 EDT 2003


Below is my filter_end.  Looks to me like the same code ya'll are using.  
I'm running sendmail 8.12.6 (patched of course) and MimeDefang 2.25.  Do 
ya'll think it may be a milter issue and i should upgrade sendmail?  Or 
should i try upgrading mimedefang first...  thanks for any advice.

ray




sub filter_end ($) {
    my($entity) = @_;

    # No sense doing any extra work
    return if message_rejected();

    # Spam checks if SpamAssassin is installed
    if ($Features{"SpamAssassin"}) {
        if (-s "./INPUTMSG" < 100*1024) {
   # Only scan messages smaller than 100kB.  Larger messages
   # are extremely unlikely to be spam, and SpamAssassin is
   # dreadfully slow on very large messages.
        my($hits, $req, $names, $report) = spam_assassin_check();
        if ($hits >= 1) {
            my $graph = '*' x ($hits > 50 ? 50 : $hits);
            action_add_header('X-Spam-Level', "$graph ($hits)");
        }
        # dump all spam over 13 to spamdrop
        if ($hits >= 13) {
            # Add a header with original recipients, just for info
            action_add_header("X-Orig-Rcpts", join(", ", @Recipients));

            # Remove original recipients
            foreach $recip (@Recipients) {
                delete_recipient($recip);
            }

            # Send to spam address
                add_recipient("spamtest\@selu.edu");
        }
    } else {
        action_add_header('X-Spam-Not-Checked',
            'Messages over 100K not checked')
    }


    }

# get rid of damn webmail putting W# in hearders -zrd 3/7/03
action_change_header('X-WebMail-UserID', "Suppressed");

} # end filter_end()




On Wed, 23 Jul 2003, Jeffrey Goldberg wrote:

> On Wed, 23 Jul 2003, David F. Skoll wrote:
> 
> > > I'm using this code, which i found in many places, to dump Spam to a
> > > spamdrop, [...]
> 
> > It works for me with MD 2.35.
> 
> What works for me (in filter_end) is
> 
>       action_change_header("X-Spam-Score", "$hits ($score) $names");
> 
>       if($hits >= 7) {
>           action_add_header("X-Orig-Rcpts", join(", ", @Recipients));
>                foreach $recip (@Recipients) {
>                     delete_recipient($recip);
>                }
>           add_recipient('spamreader at slauson.com');
>       }
>       if ($hits >= 5) {
>           add_recipient('spamtrap at slauson.com');
>       }
> 
> So anything with a score above 5 goes to spamtrap (for some automated
> testing for open relays/proxies).  Anything with a score over 7 goes to
> to a spamreader address and not the original recipients.




More information about the MIMEDefang mailing list