forward_method in policy bank does'nt work

Peter Sørensen maspsr at sdu.dk
Thu Sep 15 12:41:57 CEST 2011


Hi,

I want to redirect all spam sent from a local address to a separate server.
I use amavis 2.6.4  with a postfix (2.7.0) dual setup.

I have a policy_bank defined as

$policy_bank{'GARBAGE'} = {
                 originating => 1,
                 forward_method => ' smtp:[1.2.3.4]:25',
                 .....
};

Where 1.2.3.4 is the IP of my server handling garbage.


I use Amavis::Custom and if a certain conditions is meet I load this policy_bank


package Amavis::Custom;

use strict;



BEGIN {

  import Amavis::Conf ;          # INCLUDE ALL

  import Amavis::Util qw(do_log untaint safe_encode safe_decode);

  import Amavis::rfc2821_2822_Tools;

}



sub new {

  my($class,$conn,$msginfo) = @_;

  my($self) = bless {}, $class;

  $self;  # returning an object activates further callbacks,

}



sub checks {  # may be left out if not needed

  my($self,$conn,$msginfo) = @_;

  my($ll) = 2;  # log level (0 is the most important level, 1, 2,... 5 less so)

  do_log($ll,"CUSTOM: new message");



  my($subj) = $msginfo->get_header_field_body('subject');

   if( $subj =~ /.* <some well defined text.*/ || $msginfo->spam_level > $sa_tag_level_deflt ) {

    # Load a POLICY to service this

    Amavis::load_policy_bank( 'GARBAGE' );

    .......

    .....

  }

  $self;

}





If the condition is meet I would expect the mail to be delivered to the 1.2.3.4 server at port 25.

But this does'nt happen.



What is wrong ? is'nt this possible or should the forward_method be a method defined in the postfix master.cf


Best regards

Peter Sorensen/Univ.Of.South.Denmark/email: maspsr at sdu.dk<mailto:maspsr at sdu.dk>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.amavis.org/pipermail/amavis-users/attachments/20110915/8b626861/attachment.html>


More information about the amavis-users mailing list