[Mimedefang] quarantine bad_filename messages

Anne Bennett anne at encs.concordia.ca
Tue Sep 9 10:43:44 EDT 2014

Marcus Schopen <lists at localguru.de> asked:

>> I'd like to use "action_quarantine_entire_message" for messages
>> containing attachments with bad_filename, but not sure where to place
>> the quarantine command. Is "sub filter_bad_filename" the right place? 

"David F. Skoll" <dfs at roaringpenguin.com> replied:

> You can do it there, or you can do something like this:
> my $do_quarantine;
> sub filter_begin {
>     $do_quarantine = 0;
> }
> sub filter_bad_filename {
>     if (...) {
>        $do_quarantine = 1;
>     }
> }
> sub filter_end {
>     if ($do_quarantine) {
>        action_quarantine_entire_message(...);
>        return;
>     }
> }

But that uses a global variable that assumes that the same
slave will be used for the filter_begin and filter_end calls
- I thought we were supposed to be very careful about such
global variables.  Or is is safe to assume that although the
filter_{relay,helo,sender,recipient} calls for a given message
might be made to different slaves, once we're past the DATA
block, then filter_{begin,multipart,end} and "filter" itself
will all be under the control of a single slave?

Also, what's "filter_bad_filename"?  I find no reference to
it in the mimedefang.pl file that comes with 4.75.

Ms. Anne Bennett, Senior Sysadmin, ENCS, Concordia University, Montreal H3G 1M8
anne at encs.concordia.ca                                    +1 514 848-2424 x2285

More information about the MIMEDefang mailing list