Per user x-spam-status

Nuno Fernandes npf-mlists at eurotux.com
Wed Jul 25 17:59:58 CEST 2012


Hello,

In my setup, users get the email with the X-Spam-Status header:

X-Spam-Status: No, score=-2.881 tagged_above=-999 required=5
	tests=[AWL=-0.258, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, 
DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001......

For some users i would like to remove the values of the test scores. I'm 
trying to write a custom module for that but i don't see the header:

package Amavis::Custom;
use strict;
use Data::Dumper;

BEGIN {
   import Amavis::Conf qw(:platform :confvars c cr ca);
   import Amavis::Util qw(do_log);
}

sub new {
   my($class,$conn,$msginfo) = @_;
   bless {}, $class;
}

sub before_send {
   my($self,$conn,$msginfo) = @_;
   my($all_local) = !grep { !$_->recip_is_local } 
@{$msginfo->per_recip_data};
   if ($all_local) {
     my($hdr_edits) = $msginfo->header_edits;
     $hdr_edits->edit_header('X-Spam-Status', sub {
       open (FH, "> /tmp/log");
         print FH Dumper(\@_);
       close FH;
     });
   }
};
1;  # insure a defined return

The file /tmp/log isn't created at all. Anyone knows where the problem 
is? Is there a better way of doing that?

Thanks.
Best regards,
Nuno Fernandes


More information about the amavis-users mailing list