2.7.0-rc1: SA-header inserted twice or never

Mark Martinec Mark.Martinec+amavis at ijs.si
Fri Jun 17 20:04:20 CEST 2011


Andreas,

> I noticed that all my mails have this header twice:
> X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on ${myamavishost}
> 
> If I disable  $allowed_added_header_fields{lc('X-Spam-Checker-Version')} = 1
> in amavisd.conf, the header is not inserted at all.
> 
> I'm using amavisd-milter.
> Any Ideas ???

A  bug, thanks!
One copy inserted by amavisd itself, the other by SpamAssassin.

The following patch against 2.7.0-rc1 should get it right:


--- amavisd.orig	2011-06-15 19:33:26.043489600 +0200
+++ amavisd	2011-06-17 20:00:19.184287631 +0200
@@ -13832,4 +13832,13 @@
 
       if ($is_local && $allowed_hdrs && $use_our_hdrs) {
+        for ('X-Spam-Checker-Version') {
+          if ($extra_code_antispam_sa &&
+              $allowed_hdrs->{lc $_} && $use_our_hdrs->{lc $_}) {
+            # a hack instead of making %header_field_provided global:
+            # just mark it as already provided, this header field was
+            # already inserted by add_forwarding_header_edits_common()
+            $header_field_provided{lc $_} = 1;
+          }
+        }
         for ('X-Spam-Flag') {
           if ($allowed_hdrs->{lc $_} && $use_our_hdrs->{lc $_}) {



Mark


More information about the amavis-users mailing list