[Mimedefang] SA Question

listuser at neo.pittstate.edu listuser at neo.pittstate.edu
Mon Oct 21 11:28:00 EDT 2002


I use

    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 >= $req) {
                my($score);
                if ($hits < 100) {
                    $score = "*" x int($hits);
                } else {
                    $score = "*" x 100;
                }
          if ($hits >= $req) {
            my $fixed_report = $report;
            $fixed_report =~ s/\n+\z//g;        # fixes for multiline
header
            $fixed_report =~ s/\n/\n\t/g;       # to stop sendmail
complaining

            if ($hits >= 10) {
             action_change_header("X-Spam-Score", "$score ($hits)
$names");
             action_change_header("Subject", "***SPAM*** $Subject");
            }

            action_change_header("X-Spam-Score", "$score ($hits) $names");

            action_add_header("X-Spam-Report", "$fixed_report");
          } else {
            action_add_header("X-Spam-Score", "No, $hits ($stars)");
          }


Wrapping may make that look a bit ugly but...  That might help.  I write
the score details to the headers, score to the header on an altered
X-Spam-Score line, and alter the subject if the score is >= 10.  

HTH
 Justin



On Mon, 21 Oct 2002, Chad Stalvey wrote:

> Can someone please post the line that I need in my code to let SA's count be
> added to the header.
> 
> Here is what I have. Do I need to move:
> action_change_header("X-Spam-Score", "$hits ($score) $names");
> 
> 
>   if ($Features{"SpamAssassin"}) {
>         if (-s "./INPUTMSG" < 100*1024) {
> 
> 
>             my($hits, $req, $names, $report) = spam_assassin_check();
>             if ($hits >= $req) {
>                 my($score);
>                 if ($hits < 40) {
>                     $score = "*" x int($hits);
>                 } else {
>                     $score = "*" x 40;
>                 }
> 
> 
> 
>                 action_change_header("X-Spam-Score", "$hits ($score)
> $names");
>                 if ($hits > 12) {
>                   $bounce = "yes";
>                 # 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");
>             }
>         }
>     }
> }
> 
> 
> 
> 
> 
> Chad Stalvey
> Systems Engineer
> Hayes Computer Systems
> www.hcs.net
> 850.297.0551 ext.136
> Mobile 508.0485
> 
> _______________________________________________
> MIMEDefang mailing list
> MIMEDefang at lists.roaringpenguin.com
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
> 




More information about the MIMEDefang mailing list