Brad,

> Is there a way, perhaps in amavis::custom that I could run a custom test of
> my own, and if that test fails tell amavis to leave that message in the
> postfix deferred queue?  I essentially need to know how to communicate the
> failure to amavis.

Yes, you can override the smtp response for each recipient in the
'check' routine in custom hooks. If MTA feeds amavis through LMTP
you get true per-recipient handling, but if SMTP is used, any 4xx
response with one of the recipients causes the whole message to
tempfail. Something like the following:

sub new {
  my($class,$conn,$msginfo) = @_;
  my($self) = bless {}, $class;
  $self;  # returning an object activates further callbacks,
          # returning undef disables them
}

sub checks {  # may be left out if not needed
  my($self,$conn,$msginfo) = @_;
  for my $r (@{$msginfo->per_recip_data}) {
    if (!$r->recip_done || $r->recip_smtp_response =~ /^2/) {
      $r->recip_done(1);
      $r->recip_smtp_response('451 4.5.0 Tempfailed by custom code');
    }
  }
}


If you know the decision even before running virus and spam checks,
setting of $r->recip_done and $r->recip_smtp_response may
even be done directly in sub new.

  Mark

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
AMaViS-user mailing list
[email protected] 
https://lists.sourceforge.net/lists/listinfo/amavis-user 
 AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 
 AMaViS-HowTos:http://www.amavis.org/howto/ 

Reply via email to