[Mimedefang] SA Question
Chad Stalvey
cstalvey at hcsmail.com
Tue Oct 22 08:43:00 EDT 2002
It appears by this code that you will only mark the headers if the count is
over or equal to ten. I am wanting to have all messages have a header with
the count so that I can see the score when a piece of SPAM gets through.
I added: action_change_header("X-Spam-Score", "$hits ($score) $names");
right before the: if ($hits >= 10) {
line, but it does not work. Do I need a second test all on its own like:
if ($hits >= 1) {
action_change_header("X-Spam-Score", "$hits ($score) $names");
}
? I'm not sure on this, cause I would have figured my first try would have
worked. Thanks Again.
Chad Stalvey
-----Original Message-----
From: mimedefang-admin at lists.roaringpenguin.com
[mailto:mimedefang-admin at lists.roaringpenguin.com]On Behalf Of
listuser at neo.pittstate.edu
Sent: Monday, October 21, 2002 11:27 AM
To: mimedefang at lists.roaringpenguin.com
Subject: Re: [Mimedefang] SA Question
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
>
_______________________________________________
MIMEDefang mailing list
MIMEDefang at lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
More information about the MIMEDefang
mailing list