Question about quarantaine

Richard Smits R.Smits at
Wed Nov 30 13:29:35 CET 2016


I have a question about a piece of quarantaine code in an Amavis config 
file. Please see below :

package Amavis::Custom;
use strict;

    import Amavis::Conf qw(:platform :confvars c cr ca);

# invoked at child process creation time;
# return an object, or just undef when custom checks are not needed
sub new {
    my($class,$conn,$msginfo) = @_;
    my($self) = bless {}, $class;
    my($xspam) = $msginfo->get_header_field_body('X-Spam-Flag',0);
    my($cl_ip) = $msginfo->client_addr;
    my(@myisp) = qw( x.x.x.x/27 );

# Check if our isp is the mta
if ($cl_ip ne '' &&  Amavis::Lookup::IP::lookup_ip_acl($cl_ip,\@myisp)) {
      if ($xspam =~ /^[ \t]YES/) {
        for my $r (@{$msginfo->per_recip_data}) {
        # QUARANTINE CODE HERE ?????
# Our isp mta but no X-Spam-Flag
        for my $r (@{$msginfo->per_recip_data}) {
    $self;  # returning an object activates further callbacks,
            # returning undef disables them
1;  # insure a defined return

The reason i have this code is that we want to skip spamscanning by 
spamassassin if the mail comes from : x.x.x.x and/or has come from a 
trusted MTA, then don't do any spamscanning.
But we want to quarantine those messages as well. So my question is, 
what is the right code for this ?

I am looking into the Amavis perl module but is very large.

Greetings, Richard.

More information about the amavis-users mailing list