[Mimedefang] Help needed to block all attachments

Joseph Brennan brennan at columbia.edu
Mon Dec 17 15:02:01 EST 2012


I think maybe you want to pass only text parts, so this would do it:

-----

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

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

-----

But as I said a while ago, it depends exactly on what you mean by
attachment. The above assumes that text/plain and text/html are
good and everything else is not.

Note: Your choice of words as to 'This part has been removed'.

Joseph Brennan
Columbia University Information Technology






--On Monday, December 17, 2012 7:38 PM +0000 "Ford,Luckie J" 
<ljford at mdanderson.org> wrote:

> Any other ideas??
>
> I tested using the original bad_exts value in the original
> mimedefang-filter and it indeed blocked the attachments with the
> extensions listed in the file.  When I changed it to $bad_exts = '' as
> suggested previously, all attachments came through with none being
> blocked.
>
> I am on a network that must meet some pretty stringent security
> requirements and I have been told that in order to have SMTP running, I
> can't let ANY attachments through (of any type or extension).
>
> Any thoughts?
>
> -----Original Message-----
> From: mimedefang-bounces at lists.roaringpenguin.com
> [mailto:mimedefang-bounces at lists.roaringpenguin.com] On Behalf Of Kevin
> A. McGrail Sent: Wednesday, November 21, 2012 8:53 AM
> To: mimedefang at lists.roaringpenguin.com
> Subject: Re: [Mimedefang] Help needed to block all attachments
>
> On 11/21/2012 9:31 AM, Ford,Luckie J wrote:
>> I apologize in advance as I am an extreme mimdefang newbie that has
>> installed the product for one purpose, to block ALL attachments from
>> going through the SMTP server.  I see the ability to list specific file
>> extensions to block but that isnt what I am looking for.  I want to
>> block ALL attachments in emails.  Can someone provide specific details
>> as to what needs to be changed and where in the appropriate config
>> files.  I am forever appreciative of any help that can be provided.
> Untested but I think you could focus on filter_multipart in the example
> and other than HTML & TXT multiparts, just return action_bounce($reply,
> $code, $dsn).
>
> This might be achieved by changing the bad_exts from $bad_exts =
> '(ade|adp|app|asd|asf|asx|bas|bat|chm|cmd|com|cpl|crt|dll|exe|fxp|hlp|hta
> |hto|inf|ini|ins|isp|jse?|lib|lnk|mdb|mde|msc|msi|msp|mst|ocx|pcd|pif|prg
> |reg|scr|sct|sh|shb|shs|sys|url|vb|vbe|vbs|vcs|vxd|wmd|wms|wmz|wsc|wsf|ws
> h|\{[^\}]+\})'  to
>
> $bad_exts = ''
>
> But you might need to modify the filter_bad_filename to allow .txt files
> through.  Good luck
>
> Regards,
> KAM
> _______________________________________________
> NOTE: If there is a disclaimer or other legal boilerplate in the above
> message, it is NULL AND VOID.  You may ignore it.
>
> Visit http://www.mimedefang.org and http://www.roaringpenguin.com
> MIMEDefang mailing list MIMEDefang at lists.roaringpenguin.com
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
> _______________________________________________
> NOTE: If there is a disclaimer or other legal boilerplate in the above
> message, it is NULL AND VOID.  You may ignore it.
>
> Visit http://www.mimedefang.org and http://www.roaringpenguin.com
> MIMEDefang mailing list MIMEDefang at lists.roaringpenguin.com
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang





More information about the MIMEDefang mailing list