On Mon, 2009-06-29 at 10:49 +0200, Willy Janssen wrote:
> Hello,
> 
> We scan all outgoing mail as we absolutely don't want to send out any 
> virusses. To accomplish this, we have a two-stage (separate) Postfix 
> setup, connected via a content_filter for Amavis/ClamAV:
> 
> Postfix (incoming stage) --> Amavis/ClamAV --> Postfix (sending stage)
> 
> However, during the last days some virusses seemed to slip through (we 
> were trapped by an external party). What I can think of is the 
> possibility that a mail is scanned and found to be clean is going 
> to the second Postfix and sits there in the queue. Suppose it cannot be 
> delivered immediately.
> 
> As the queue lifetime is in the order of days, it can take a while 
> before the message is delivered. During that time the ClamAV database 
> could be updated to recognize this message as a virus. However, it won't 
> get scanned again as it is already in the outgoing queue. And we're 
> sending the virus mail.
> 
> My question, is it possible to requeue a message to the first stage (the 
> incoming) to scan the mail again? I would like to run this process 
> whenever there's an update of the ClamAV database.
> 
> The command 'postsuper -r <ID>' requeues it to the second stage Postfix, 
> so that's no solution.
> 
> Regards, Willy Janssen, University of Nijmegen, The Netherlands
A random stab in the dark, but perhaps along the lines of;

mv /path/to/secondstage/outbound/deferred/message_id /path/to/firstage/maildrop/

The key is getting the file name from the queue ID. I suspect cleanup
will do the housekeeping if the file is missing from deferred, but I
expect there will be an easier and cleaner way to do this properly. I'm
a well known, self confessed 'bodger'.

Reply via email to