<div dir="ltr"><div>Hi,<br><br></div><div>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.<br><br></div><div>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:<br>
</div><div><br>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.<br>
<br></div><div>My custom config looks like this:<br><br>package Amavis::Custom;<br>use strict;<br><br>use DBI qw(:sql_types);<br>use DBD::mysql;<br><br># needed for write_to_db()<br>use DB_File;<br>use IO::File;<br><br>BEGIN {<br>
import Amavis::Log qw(write_log);<br> import Amavis::Conf qw(:platform :confvars c cr ca $myhostname);<br> import Amavis::Util qw(do_log prolong_timer ll untaint safe_encode safe_decode);<br> import Amavis::rfc2821_2822_Tools;<br>
import Amavis::In::Message::PerRecip;<br>}<br><br>sub before_send {<br> my($self,$conn,$msginfo) = @_;<br> ....<br> my($loc_level) = $msginfo->spam_level; # spam level (without per-recip boost)<br>}<br><br>
</div><div>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.<br><br>Thanks,<br></div><div>Alex<br><br></div><div><br><br><br></div></div>