More Amavis::Custom questions

Michael Storz Michael.Storz at lrz.de
Sat Apr 27 18:44:52 CEST 2013


Am 2013-04-27 04:13, schrieb Alex:
> Hi all,
>
> As I mentioned in a recent post, I'm trying to use Amavis::Custom in
> v2.8.0 to build a database of quarantined messages. This was working
> with 2.6.6, but it looks like Amavis::In::Message has since changed,
> and some of the functions have been moved to
> Amavis::In::Message::PerRecip, I believe.
>
> Now I don't understand why $msginfo->infected seems to no longer
> exist. Is there a replacement equivalent?

Use $msginfo->is_in_contents_category(CC_VIRUS) or the data from 
per_recip_data $r->is_in_contents_category(CC_VIRUS).

As you said previously spam_level is now part of per_recip_data. Access 
it by $r->spam_level.

>
> Here is the code section from my amavisd-custom.conf file:
>
> package Amavis::Custom;
> use strict;
>
> BEGIN {
>  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
> safe_decode);
>  import Amavis::rfc2821_2822_Tools;
>  }
> ...
> sub before_send {
>  my($self,$conn,$msginfo) = @_;
>
>  my($loc_logid) = $msginfo->log_id; # log ID string, e.g. 
> '48262-21-2'
>  my($loc_size) = $msginfo->msg_size; # mail size in bytes
>  #my($loc_level) = $msginfo->spam_level; # spam level (without 
> per-recip boost)
>  my($loc_digest) = $msginfo->body_digest;
>  my($loc_partit) = $msginfo->partition_tag;
>  my($loc_mail) = $msginfo->mail_id;
>
>  my ($loc_rmbxname,$loc_infect,$loc_slevel);
>  for my $r (@{$msginfo->per_recip_data}) {
>  $loc_rmbxname = $r->recip_mbxname;
>  $loc_infect = $r->infected;
>  }
>
> The only functions that don't work here are $r->infected and
> $msginfo->spam_level. Have they been moved? What is the best way to
> access this info?
>
> Thanks,
> Alex


More information about the amavis-users mailing list