Ockleford Paul (NHS Connecting for Health):
> Hi,
> 
> Hopefully someone on this list can help me out. I am trying to
> set up mime-header checking to only allow through emails with a
> particular file extension, that is I want to block any email
> without this attachment type or any other attachment type.

First, you need to ensure that the rule is applied only to
Content-Type/Disposition headers and not to other MIME headers.

Second, negative matching can be tricky. It may be easier to
eliminate the good cases first, as shown below.

Untested PCRE example:

if /^Content-(Disposition|Type):/
/name\s*=\s*"?(.*(\.|=2E)(aaa|bbb))(\?=)?"?\s*(;|$)/x DUNNO
/./ REJECT Attachment name must end in ".aaa" or ".bbb"
endif

        Wietse

Reply via email to