bad_header_lovers
Alexander Wirt
formorer at formorer.de
Mon Jan 26 20:53:07 CET 2015
On Mon, 26 Jan 2015, Pasi Kärkkäinen wrote:
> Hello,
>
> Replying to an old thread..
>
> On Fri, Mar 23, 2012 at 02:47:33PM +0100, Mark Martinec wrote:
> > 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;
> >
>
>
> I'm not a perl expert but should that be "return $self" instead?
From the manpage:
In the absence of an explicit "return", a subroutine, eval, or do
FILE automatically returns the value of the last expression
evaluated
But it is nicer to be explicit.
More information about the amavis-users
mailing list