Can't locate object method spam_level using Amavis::In::Message

Alex via amavis-users amavis-users at
Thu Apr 17 22:46:12 CEST 2014


I've migrated from an older version of amavisd to amavisd-2.8.1 on fc20 and
now having a problem with a custom config that worked with the previous

I'm trying to use the spam_level() function and it looks like it's now in
the Amavis::In::Message::PerRecip package. I'm receiving the following
error and unable to figure out how to provide access to this function in my
custom config:

Apr 17 16:37:59 mail01 amavis[3657]: (03657-03) (!)custom before_send
error: Can't locate object method "spam_level" via package
"Amavis::In::Message" at /etc/amavisd/amavisd-custom.conf line 118.

My custom config looks like this:

package Amavis::Custom;
use strict;

use DBI qw(:sql_types);
use DBD::mysql;

# needed for write_to_db()
use DB_File;
use IO::File;

  import Amavis::Log qw(write_log);
  import Amavis::Conf qw(:platform :confvars c cr ca $myhostname);
  import Amavis::Util qw(do_log prolong_timer ll untaint safe_encode
  import Amavis::rfc2821_2822_Tools;
  import Amavis::In::Message::PerRecip;

sub before_send {
  my($self,$conn,$msginfo) = @_;
  my($loc_level)        = $msginfo->spam_level; # spam level (without
per-recip boost)

For brevity, I've omitted the new() function and others that I don't think
are relevant. Please let me know if that is necessary.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the amavis-users mailing list