[Mimedefang] quarantine_entire_message: I don't get it

Paul Boven p.boven at chello.nl
Mon Sep 20 14:48:41 EDT 2004


Hi David, everyone,

David F. Skoll wrote:
>>replace_entire_message() may only be called from filter_end(), but the
>>virus-scanning gets done in filter_begin(). What would be the proper way
>>to transfer the outcome of the virus-scan between those two functions,
>>or should I just move the virus-scanning to filter_end() too?

> You could either set a global variable in filter_begin:
> 
> sub filter_begin {
> 	$FoundVirus = 0;
> 	if (message_contains_virus()) {
> 		$FoundVirus = 1;
> 		# ...
> 	}
> }
> 
> sub filter_end {
> 	if ($FoundVirus) {
> 		# ...
> 	}
> }
> 
> or you could run the virus check in filter_end.

It turns out that $FoundVirus is already a global variable in the 
current example mimedefang-filter, so I just needed to alter filter_end().
And after wasting another 5 minutes on realising that action_discard 
will happily throw away the new mail-body that gets created later on, 
everything is working as intended.

Thanks for the quick replies, regards,

Paul Boven.



More information about the MIMEDefang mailing list