]> git.pld-linux.org Git - packages/amavisd-new.git/blame - amavisd-new-more-headers.patch
- adapterized
[packages/amavisd-new.git] / amavisd-new-more-headers.patch
CommitLineData
55aa7e3b
JR
1diff -ur amavisd-new-20020517.orig/amavis/amavisd.in amavisd-new-20020517/amavis/amavisd.in
2--- amavisd-new-20020517.orig/amavis/amavisd.in Tue Sep 17 15:27:37 2002
3+++ amavisd-new-20020517/amavis/amavisd.in Tue Sep 17 15:27:29 2002
4@@ -380,7 +380,7 @@
5
6 # Razor, SpamAssassin
7 my(%razor_options, $razor_body_signature, $spamassasin_obj);
8-my($spam_found, $spam_report);
9+my($spam_found, $spam_report, $spam_hits);
10 use vars qw ( %whitelist_sender @whitelist_sender );
11
12 my(%scan_cache, $body_signature, @timing);
13@@ -810,7 +810,7 @@
14 $entity = undef; @SENDER_CONTACT = ( $SENDER );
15 $VIRUSFILE = undef; $output = undef; @virusname = ();
16 $some_compression = 0; getfilename_reset();
17- $spam_found = undef; $spam_report = undef;
18+ $spam_found = undef; $spam_report = undef; $spam_hits = undef;
19 $body_signature = undef;
20 $razor_body_signature = undef;
21
22@@ -924,7 +924,7 @@
23 }
24 } else {
25 $which_section = "spam_scan";
26- $spam_found = spam_scan($fh);
27+ ($spam_found,$spam_hits) = spam_scan($fh);
28 prolong_timer($which_section);
29 if (defined($body_signature)) { # save results to cache
30 $scan_cache{$body_signature}{'SF'} = $spam_found;
31@@ -1223,7 +1223,12 @@
32 $_ .= "X-AMaViS-Alert: INFECTED, message contains virus: "
33 . join(', ',@virusname) . "\n" if @virusname;
34 $_ .= "X-Razor-id: $razor_body_signature\n" if $razor_body_signature ne "";
35- $_ .= "X-Spam-Status: $spam_report\n" if $spam_found && $spam_report ne "";
36+ if ($spam_found) {
37+ $_ .= "X-Spam-Status: $spam_report\n" if $spam_report ne "";
38+ $_ .= "X-Spam-Flag: YES\n";
39+ $_ .= "X-Spam-Level: " . '*' x ($spam_hits <= 0 ? 0 :
40+ ($spam_hits > 40 ? 40 : int($spam_hits+0.5))) . "\n";
41+ }
42 $_ .= "\n";
43 &$print_method($_) or die "sending mail header3: $!";
44 }
45@@ -2032,7 +2037,7 @@
46
47 # try SpamAssassin
48
49- my($sa_spam_found,$per_msg_status);
50+ my($sa_spam_found,$per_msg_status,$sa_hits);
51 if ($size > $sa_mail_size_limit) {
52 do_log(1, "spam_scan: don't waste time on SA, message longer than $sa_mail_size_limit bytes");
53 $sa_spam_found = $razor_spam_found;
54@@ -2056,7 +2061,7 @@
55 $sa_spam_found = $razor_spam_found;
56 $spam_report = "tests=Razor" if $razor_spam_found;
57 } else {
58- my($sa_hits) = $per_msg_status->get_hits
59+ $sa_hits = $per_msg_status->get_hits
60 + ($razor_spam_found ? 3 : 0);
61 $sa_spam_found = $sa_hits >= $per_msg_status->get_required_hits;
62 $spam_report = sprintf("hits=%3.1f tests=%s",
63@@ -2073,7 +2078,7 @@
64 $spam_report = ($sa_spam_found ? 'Yes' : 'No') .
65 ($spam_report ne '' ? ', ' : '') . $spam_report;
66 do_log( ($sa_spam_found ? 0 : 1), "spam_scan: $spam_report, <$SENDER>");
67- $sa_spam_found;
68+ ($sa_spam_found, $sa_hits);
69 }
70
71 #
This page took 0.098026 seconds and 4 git commands to generate.