Hello,
I've always been frustrated about amavisd not setting the
X-Spam-Languages header (while it -by default- loads the TextCat
SpamAssassin plugin, so the information is there and it take some CPU
time to figure it out), but now I actually need it, so made the
following patch to the latest (from FreeBSD ports) amavisd.
By default amavisd now includes the X-Spam-Languages header. If backward
compatibility is required, X-Spam-Languages should not be added in the
allowed_added_header_fields hash, so this produces the current output
with the possibility to include the header if needed.
Mark, do you think it's OK to include it in the mainline?
Thanks,
--- amavisd.orig 2008-01-03 18:22:38.000000000 +0100
+++ amavisd 2008-01-03 19:24:29.000000000 +0100
@@ -825,7 +825,7 @@
Received X-Quarantine-ID X-Amavis-Alert X-Amavis-Hold X-Amavis-Modified
X-Amavis-PenPals X-Amavis-OS-Fingerprint X-Amavis-PolicyBank
X-Spam-Status X-Spam-Level X-Spam-Flag X-Spam-Score
- X-Spam-Report X-Spam-Checker-Version X-Spam-Tests
+ X-Spam-Report X-Spam-Checker-Version X-Spam-Tests X-Spam-Languages
X-DSPAM-Signature X-DSPAM-Result
X-DSPAM-Confidence X-DSPAM-Probability X-DSPAM-User X-DSPAM-Factors
);
@@ -9760,7 +9760,7 @@
if ($extra_code_antispam) {
if (c('remove_existing_spam_headers')) {
my(@which_headers) = qw(
- X-Spam-Status X-Spam-Level X-Spam-Flag X-Spam-Score
+ X-Spam-Status X-Spam-Level X-Spam-Flag X-Spam-Score
X-Spam-Languages
X-Spam-Report X-Spam-Checker-Version X-Spam-Tests);
push(@which_headers, qw(
X-DSPAM-Result X-DSPAM-Confidence X-DSPAM-Probability
@@ -18159,6 +18159,7 @@
my($which_section); my(@lines);
my($spam_level,$sa_tests,$spam_report,$spam_summary,$supplementary_info_ref);
my($fh) = $msginfo->mail_text;
+ my($allowed_hdrs) = cr('allowed_added_header_fields');
my($hdr_edits) = $msginfo->header_edits;
if (!$hdr_edits) {
$hdr_edits = Amavis::Out::EditHeader->new;
@@ -18206,7 +18207,6 @@
# keep X-DSPAM-*, ignore other changes e.g. Content-Transfer-Encoding
my($all_local) = !grep {!$_->recip_is_local}
@{$msginfo->per_recip_data};
my($first_line); my($ln);
- my($allowed_hdrs) = cr('allowed_added_header_fields');
# scan mail header from DSPAM
for ($! = 0; defined($ln=$proc_fh->getline); $! = 0) {
$dspam_fh->print($ln) or die "Can't write to $dspam_fname: $!";
@@ -18296,6 +18296,10 @@
# $hdr_edits->add_header('X-Relay-Countries',$rly_country)
# if $rly_country ne '' && $all_local &&
# $allowed_hdrs && $allowed_hdrs->{lc('X-Relay-Countries')};
+
$hdr_edits->add_header('X-Spam-Languages',$supplementary_info_ref->{'LANGUAGES'})
+ if ($supplementary_info_ref->{'LANGUAGES'} ne '' && $allowed_hdrs &&
+ $allowed_hdrs->{lc('X-Spam-Languages')});
+
if (defined $dspam && $dspam ne '' && defined $spam_level) { #
auto-learn
$which_section = 'DSPAM learn';
my($eat,@options);
--
Attila Nagy e-mail: [EMAIL PROTECTED]
Free Software Network (FSN.HU) phone: +3630 306 6758
http://www.fsn.hu/
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/