That was it!  Thanks So Much!

On 02/20/2014 12:54 AM, Mark Martinec wrote:
psychobyte,

I'm trying to do some filtering on the originating IP address of a
message using a custom plugin on SA-3.3.2-r1

I have this variable set in my .cf file(same as trusted networks var):
  awl_ignore_networks    143.31/16 69.21/16 10.0.1/24

I've declared my awl_ignore_networks like so:

sub set_config {
  my($self, $conf) = @_;
  my @cmds;

  push (@cmds, {
    setting => 'awl_ignore_from',
    type => $Mail::SpamAssassin::Conf::CONF_TYPE_ADDRLIST
  });
  push (@cmds, {
    setting => 'awl_ignore_networks',
    type => $Mail::SpamAssassin::Conf::CONF_TYPE_IPADDRLIST
  });
  $conf->{parser}->register_commands(\@cmds);
}

Feb 13 11:49:54 mymailserver amavisd[9642]: (!!)TROUBLE in
pre_loop_hook: Can't call method "add_cidr" on an undefined value at
/usr/lib64/perl5/vendor_perl/5.16.3/Mail/SpamAssassin/Conf/Parser.pm
line 713.

Missing initialization of $conf->{awl_ignore_networks} :

  push (@cmds, {
    setting => 'awl_ignore_from',
    type => $Mail::SpamAssassin::Conf::CONF_TYPE_ADDRLIST
  });

  $conf->{awl_ignore_networks} = Mail::SpamAssassin::NetSet->new;
  push (@cmds, {
    setting => 'awl_ignore_networks',
    type => $Mail::SpamAssassin::Conf::CONF_TYPE_IPADDRLIST
  });

( it's ugly, I know :)

Mark

Reply via email to