[Mimedefang] Report

Carol Man mimedefang at yahoo.com
Wed Jul 2 10:47:02 EDT 2003


Stefano,

  here is the part that it's in my SA.. I made some
changes from the default SA, because in the begining
it wasn't working.. =P .. hope you can help me..

  Thanks!! 

  Carol


 
 # Spam checks if SpamAssassin is installed
    if ($Features{"SpamAssassin"}) {
        if (-s "./INPUTMSG" < 15000*1024) {
            # Only scan messages smaller than 15000kB.
 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 >= $req) {
                md_log('spam', $hits, $RelayAddr);
                my($score);
                if ($hits < 40) {
                    $score = "*" x int($hits);
                } else {
                    $score = "*" x 40;
                }
                # We add a header which looks like
this:
                # X-Spam-Score: 6.8 (******)
NAME_OF_TEST,NAME_OF_TEST
                # The number of asterisks in parens is
the integer part
                # of the spam score clamped to a
maximum of 40.
                # MUA filters can easily be written to
trigger on a
                # minimum number of asterisks...
                #action_change_header("X-Spam-Score",
"$hits ($score) $names");

                action_add_header("X-Spam-Warning",
"SpamAssassin says this message is SPAM");
                action_add_header("X-Spam-Status",
"Yes, hits=$hits required=$req");
               
action_add_header("X-Spam-Report","$report");
                } else {
                action_add_header("X-Spam-Status",
"No");
               }
                # if we're quite confident it actually
IS spam, just bounce it
                if ($hits > 5) {
                action_quarantine_entire_message();
                action_bounce("Message seems to be
spam, rejected");
                }
                # If you find the SA report useful,
add it, I guess...
                action_add_part($entity, "text/plain",
"-suggest",
                                "$report\n",
                               
"SpamAssassinReport.txt", "inline");
            } else {
                # Delete any existing X-Spam-Score
header?
                action_delete_header("X-Spam-Score");
            }





--- Stefano McGhee wrote:

> Anyway, the stock mimedefang-filter for 2.33, the
> version I'm using, does
> not seem to attach a report unless the SA score
> comes back as ($hits >=
> $req).  Did you change the logic of filter_end at
> all?  Pay attention to
> the part below:
> 
>     # Spam checks if SpamAssassin is installed
>     if ($Features{"SpamAssassin"}) {
> 
> Let us know if that has been changed.  It may just
> be that the section:
> 
> # If you find the SA report useful, add it, I
> guess...
>                 action_add_part($entity,
> "text/plain", "-suggest",
>                                 "$report\n",
>                                
> "SpamAssassinReport.txt", "inline");
> May have gotten misplaced and is getting executed
> all the time, instead of
> only when $hits exceed $req.
> 
> Cheers,
> 
> Stefano
> > 
> 

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com



More information about the MIMEDefang mailing list