[Mimedefang] mimedefang doesn't appear to be running...
Paul Heinlein
heinlein at cse.ogi.edu
Tue Jan 6 09:26:17 EST 2004
On Tue, 6 Jan 2004, Josh Fryman wrote:
> SA current versions generate the tag in headers:
>
> X-Spam-Status:
>
> followed by a yes/no, and then the hit/score data. the mimedefang
> handling removes this and replaces it with just the score, ***, and
> useful test hits.
>
> is there a way to leave that unmodified?
We dealt with this issue by building those headers and adding them in
filter_end(), e.g.,
sub filter_end ($) {
# ...
# clear away any existing spamassassin-esque headers
foreach my $hdr (qw/Checker-Version Flag Level Report Score Status/) {
action_delete_all_headers( "X-Spam-$hdr" );
}
if (-s "./INPUTMSG" < 250*1024) {
my($hits, $req, $names, $report) = spam_assassin_check();
# make the spamassassin return values resemble their appearance
# when using the standalone spamassassin/spamc clients
$req = sprintf("%2.2f", $req);
$hits = sprintf("%2.2f", $hits);
$report =~ s!\bSPAM:\s*!!g;
$report =~ s!\n+\z!!g;
$report =~ s!\n+!\n\t!g;
# generate info for headers
my $is_spam = ($hits >= $req) ? 'Yes' : 'No';
my $sastatus = "$is_spam,\n\thits=$hits required=$req\n\ttests=$names";
my $sastars = ($hits > 0) ? ( '*' x int($hits) ) : '';
# headers that always get added
action_add_header( 'X-Spam-Status', $sastatus );
action_add_header( 'X-Spam-Level', $sastars );
action_add_header( 'X-Spam-Checker-Version', $saversion );
# headers only for messages marked spam; add a leading zero to
# hit counts less than 10 so users can effectively sort their
# spam messages numerically by hit count
if ($hits >= $req) {
$hits = "0$hits" if $hits < 10;
my $newsubject = "**SPAM $hits** $Subject";
action_change_header( 'Subject', $newsubject, 1 );
action_add_header( 'X-Spam-Report', $report );
action_add_header( 'X-Spam-Flag', 'YES' );
}
}
md_graphdefang_log('mail_in');
}
-- Paul Heinlein <heinlein at cse.ogi.edu>
More information about the MIMEDefang
mailing list