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

Mark Martinec via amavis-users amavis-users at
Wed May 7 00:48:48 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
> version.
> 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.

Indeed, the spam_level() is now a property of a recipient because in
a multi-recipient mail message with some per-recipient score 
like penpals, each recipient may come up with somewhat different spam 

> My custom config looks like this:
> my($loc_level) = $msginfo->spam_level;

You need to walk through all recipients of a mail message and collect
each score. As a summary value perhaps a max or a min value (or 
in-between) may still be useful. Perhaps:

   my($min_spam_level, $max_spam_level) =


More information about the amavis-users mailing list