[Mimedefang] Help needed to block all attachments

David F. Skoll dfs at roaringpenguin.com
Mon Dec 17 15:18:36 EST 2012


On Mon, 17 Dec 2012 20:12:45 +0000
"Ford,Luckie J" <ljford at mdanderson.org> wrote:

>  - I don't typically support email in any shape or fashion, thus the
> reason for my original statement that I will need all the help I can
> get.
>  - I didn't blindly change the sample filter.  I did so as a result
> of a suggestion from a response to my original post for help.

OK.  We feel your pain. ;)

>  - By attachment, yes I meant any non-text part.

I'd use a slightly modified version of Joseph Brennan's suggestion:

sub filter {
	my($entity, $fname, $ext, $type) = @_;

        if ($type !~ /^text\//i) {
		action_replace_with_warning('This part has been removed');
        }
}

NOTE: This sure looks safe, but I bet that Microsoft Windows will happily
run a text/plain part called "gotcha.exe".  Such is life with Windoze.

Regards,

David.



More information about the MIMEDefang mailing list