We are going to cut over from one quarantine method to another, so for a little 
while, I need to simultaneously quarantine spam in two different ways.

Right now, I'm forwarding all spam to a single mailbox via smtp.

I need to add sql quarantine as well.

I've got the sql quarantining working in the main configuration, so I was 
thinking about using a before_send custom hook to add in the SMTP-based 
quarantine (so it's easy to remove later, when we've completed our upgrade).  

Would before_send be the best place to do this?

Would something like this work?

sub before_send {
  my($self,$conn,$msginfo) = @_;
  if ($msginfo->quarantined_to) {
      my($quar_addr) = 'quarant...@mydomain.com';
      Amavis::do_quarantine($conn, $msginfo, undef,
                            [$quar_addr],
                            'smtp:[127.0.0.1]:10025:email');
  }
}

Or do I need to call it separately for each recipient, in a loop like this:

sub before_send {
  my($self,$conn,$msginfo) = @_;
  for my $r (@{$msginfo->per_recip_data}) {  # $r contains per-recipient data
     if ($r->SOMETHING) {  # can I check to see if it was quarantined for a 
specific user?
         my($quar_addr) = 'quarant...@mydomain.com';
         Amavis::do_quarantine($conn, $msginfo, undef,
                            [$quar_addr],
                            'smtp:[127.0.0.1]:10025:email');
     }
  }
}



Thanks-

Tim
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/amavis-user 
 Please visit http://www.ijs.si/software/amavisd/ regularly
 For administrativa requests please send email to rainer at openantivirus dot 
org

Reply via email to