excluding checks for @mynetowrks - amavis vs. postfix problem

Mark Martinec Mark.Martinec+amavis at ijs.si
Wed Sep 21 16:00:25 CEST 2011


Tomas,

> I want to exclude some part of Postfix's mynetworks from Amavis spam checks, 
> but really only some part, the rest should be checked as ussual. The "some 
> part" is a subnet, in that I have all my servers sending emails, that should
> be excluded.
> For example here I'm trying to say, that my servers (that I want to exclude) 
> are in 192.168.0.0/29 subnet.

 @client_ipaddr_policy = (
   [qw( 192.168.0.0/29 )] => 'MYSERVERS',
   \@mynetworks => 'MYNETS',
 );

$policy_bank{'MYSERVERS'} = {
  originating => 1,
  bypass_decode_parts => 1,
  bypass_virus_checks_maps => [1],
  bypass_banned_checks_maps => [1],
  bypass_spam_checks_maps => [1],
};


amavisd-new-2.6.3 release notes:

- added a configuration variable @client_ipaddr_policy, which maps smtp
  client's IP address lookup lists to a policy bank name. This allows for
  loading a policy bank based on a client IP address, and generalizes a
  formerly hard-wired mapping of @mynetworks_maps into 'MYNETS'.
  The list is traversed in order, the first matching networks list stops
  the search and its associated policy name is used. Suggested by Jo Rhett.

  The default setting retains backwards compatibility:

    @client_ipaddr_policy = map { $_ => 'MYNETS' } @mynetworks_maps;

  but please keep in mind that this assignment is made during startup
  before evaluating a config file, so if amavisd.conf changes the
  @mynetworks_maps list, the assignment to @client_ipaddr_policy needs to
  be re-evaluated to retain a desired default. This is not necessary when
  @mynetworks_maps is left untouched but only its component @mynetworks
  is changed.

  Example:
    @client_ipaddr_policy = (
      [qw( 0.0.0.0/8 127.0.0.1/8 [::] [::1] )]            => 'LOCALHOST',
      [qw( !172.16.1.0/24 172.16.0.0/12 192.168.0.0/16 )] => 'PRIVATENETS',
      [qw( 192.0.2.0/25 192.0.2.129 192.0.2.130 )]        => 'PARTNER',
      \@some_other_networks  => 'OTHER',
      \@mynetworks           => 'MYNETS',
    );



Mark


More information about the amavis-users mailing list