bad_header_lovers

Mark Martinec Mark.Martinec+amavis at ijs.si
Fri Mar 23 14:47:33 CET 2012


Andrea,

> I need to skip the bad_header results based on the from address.
> Is it possible? If yes, haw can I configure it?

Currently you can only do this through loading of a policy bank,
e.g.:

$policy_bank{'NOHCHK'} = {
  bypass_header_checks_maps => [1]
};

A policy bank can be loaded based on an incoming TCP port number,
or based on a SMTP client's IP address, or based on a valid DKIM
signature. This is certainly a cleanest and simplest solution,
e.g.:

@author_to_policy_bank_maps = (
  {
    'example.com' => 'NOHCHK',
  }
);


There is no off-the-shelf mechanism to load a policy bank based
on a sender address, although you can do so through a custom hook,
e.g.:

amavisd.conf:
  include_config_files('/etc/amavisd-custom.conf');


amavid-custom.conf:

package Amavis::Custom;
use strict;

sub new {
  my($class,$conn,$msginfo) = @_;
  my $self = bless {}, $class;
  if ($msginfo->sender =~ /\@example\.com\z/i ) {
    Amavis::load_policy_bank('NOHCHK',$msginfo);
  }
  $self;
}

1;



  Mark


More information about the amavis-users mailing list