[Mimedefang] FW: MIME Digests
Barry Byrne
barry.byrne at wbtsystems.com
Tue Aug 13 10:39:00 EDT 2002
Sorry to correct myself I should have reread my code - but anyway the number
of star is actually based on the $level (value 0-20). Negative scores are
converted to zero (hence no stars).
- Barry
>
> Jeff:
>
> The stars header only goes is if the it is deemed to be spam [if ($hits >=
> $req)]. In other words, $hits must be greater than 5
> (required=5). Your mail
> score below is -9.6 (negative) so no header added, as SA doesn't consider
> this to be spam.
>
> Cheers,
>
> Barry
>
> > Barry,
> > Thanks for the information. I must have done something wrong, but can't
> > figure it out. Here is the output I get from the script:
> >
> > X-Spam-Status: No, hits=-9.6 required=5
> > X-Spam-Level: (-9.6)
> > X-Scanned-By: MIMEDefang 2.16 (www . roaringpenguin . com / mimedefang)
> >
> >
> > You will notice I don't get the stars. Here is the script I put
> > in. Maybe
> > I did a typo that I just can't see.
> >
> > # Spam checks if SpamAssassin is installed
> > if ($Features{"SpamAssassin"}) {
> > if ((-s "./INPUTMSG") <= (200 * 1024)) {
> > my($hits, $req, $names, $report) = spam_assassin_check();
> > my $level = $hits;
> > # Build a 'star' rating from 0 - 20;
> > if ( $level < 0 ) { $level = 0 }
> > if ( $level > 20 ) { $level = 20 }
> > my $stars = '*' x $level;
> > 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
> > action_add_header("X-Spam-Status", "Yes, hits=$hits
> > required=$req");
> > action_add_header("X-Spam-Level", "$stars ($hits)");
> > action_add_header("X-Spam-Report","$fixed_report");
> > } else {
> > action_add_header("X-Spam-Status", "No, hits=$hits
> > required=$req");
> > action_add_header("X-Spam-Level", "$stars ($hits) $names");
> > }
> > }
> >
> >
> > Thanks for the help.
> >
> > on 8/12/02 9:25 AM, Barry Byrne at barry.byrne at wbtsystems.com wrote:
> >
> > > Excerpt from my mimedefang-filter:
> > >
> > > if ((-s "./INPUTMSG") <= (200 * 1024)) {
> > > my($hits, $req, $names, $report) = spam_assassin_check();
> > > my $level = $hits;
> > > # Build a 'star' rating from 0 - 20;
> > > if ( $level < 0 ) { $level = 0 }
> > > if ( $level > 20 ) { $level = 20 }
> > > my $stars = '*' x $level;
> > > 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
> > > action_add_header("X-Spam-Status", "Yes, hits=$hits
> required=$req");
> > > action_add_header("X-Spam-Level", "$stars ($hits)");
> > > action_add_header("X-Spam-Report","$fixed_report");
> > > } else {
> > > action_add_header("X-Spam-Status", "No, hits=$hits
> required=$req");
> > > action_add_header("X-Spam-Level", "$stars ($hits)");
> > > }
> > > }
> > >
> > > --
> > > Barry Byrne, IT Manager,
> > > WBT Systems, Block 2, Harcourt Centre
> > > Harcourt Street, Dublin 2, Ireland
> > >
> > >
> > >> -----Original Message-----
> > >> From: mimedefang-admin at lists.roaringpenguin.com
> > >> [mailto:mimedefang-admin at lists.roaringpenguin.com]On Behalf Of Jeff
> > >> Grossman
> > >> Sent: 12 August 2002 17:06
> > >> To: mimedefang at lists.roaringpenguin.com
> > >> Subject: Re: [Mimedefang] FW: MIME Digests
> > >>
> > >>
> > >> on 8/12/02 8:41 AM, Barry Byrne at barry.byrne at wbtsystems.com wrote:
> > >>
> > >>> I just add the SA report to the headers - less intrusive for
> > >> most users and
> > >>> still there if they want it.
> > >>
> > >> Okay, how do I just have the report in the headers and not in
> > the actual
> > >> message?
> > >>
> > >> Thanks,
> > >> Jeff
> > >> --
> > >> Jeff Grossman (jeff at grossman.name)
> > >>
> > >> _______________________________________________
> > >> MIMEDefang mailing list
> > >> MIMEDefang at lists.roaringpenguin.com
> > >> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
> > >>
> > > _______________________________________________
> > > MIMEDefang mailing list
> > > MIMEDefang at lists.roaringpenguin.com
> > > http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
> > >
> >
> > --
> > Jeff Grossman (jeff at grossman.name)
> >
> > _______________________________________________
> > MIMEDefang mailing list
> > MIMEDefang at lists.roaringpenguin.com
> > http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
> >
>
> _______________________________________________
> MIMEDefang mailing list
> MIMEDefang at lists.roaringpenguin.com
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
>
More information about the MIMEDefang
mailing list