Hi,

My goal is to ignore several types of address from getting into the AWL database. So I'm creating a plugin that will set a lower priority for autolearn_discriminator(), run the autolearn_discriminator callback, check a list of ignored address types, then call inhibit_further_callbacks() stop the address from getting into the AWL database.

Does that process sound right? Below is a test implementation, however it doesn't seem to work. The autolearn_discriminator callback doesn't get called. What am I doing wrong?

I'm using spamassassin-3.3.1-r4


==================================
package TestPlugin;
use Mail::SpamAssassin::Plugin;
use strict;

use vars qw(@ISA);
@ISA = qw(Mail::SpamAssassin::Plugin);

# constructor: register the eval rule
sub new {
  my $class = shift;
  my $mailsaobject = shift;

  # some boilerplate...
  $class = ref($class) || $class;
  my $self = $class->SUPER::new($mailsaobject);
  bless ($self, $class);
  dbg("testplugin: constructor");

  $self->set_config($mailsaobject->{conf});
  $self->register_method_priority('autolearn_discriminator', 0);
  return $self;
}


sub autolearn_discriminator {
    my $this = shift;
    my $status = shift()->{permsgstatus};
    dbg("testplugin: autolearn_discriminator");
    return;
}

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

=item awl_ignore_from

Ignore address types from going into the AWL database.

=cut

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

}

sub dbg { Mail::SpamAssassin::dbg (@_); }

1;

Reply via email to