Hi, Thanks for the response, what I want to do is only allow one type of attachment through though. I have a service which processes attachments, so rather than give a list of disallowed attachments, I want to do the opposite and only give a list of allowed attachments. In this case only emails containing a .ecf attachment should be allowed through, nothing else, including emails without an attachment should be received.
I have used regexp in my config file. Paul -----Original Message----- From: owner-postfix-us...@postfix.org [mailto:owner-postfix-us...@postfix.org] On Behalf Of Simon Waters Sent: 08 June 2010 12:18 To: postfix-users@postfix.org Subject: Re: Setting mime-header checking On Tuesday 08 June 2010 12:04:36 Ockleford Paul (NHS Connecting for Health) wrote: > I would be grateful if anybody is able to offer some assistance. > > mime_header_checks > > #!/^\s*Content-(Disposition|Type).*name\s*=\s*"{1,1}.+\.(ecf)"{1,1}\s*$/!/n >ame=[^>]*\.(ecf)/ WARN Would normally reject this message > #!/^[[:space:]]*content-(type|disposition):.*name[[:space:]]*=.*\.(ecf)/ > # WARN Bad attachment file name extension > I have one scrounged from the list: regexp:headercheck /^\s*Content-(Disposition|Type).*name\s*=\s*"?(.+\.(cpl|asd|hlp|ocx|reg|bat| c[ho]m|cmd|exe|dll|vxd|pif|scr|hta|sh[mbs]|vb[esx]|ws[fh]|wav|mov|wmf|xl))"? \s*$/ REJECT Attachment type not allowed. File "$2" has the unacceptable extension "$3" Which is tested in battle. There is an example for pcre in the Postfix docs. http://www.postfix.org/header_checks.5.html Isn't immediately apparent why your regexp fails to me, but I'd suggest not reinventing regexp here. Be careful to distinguish if it is regexp: or pcre: Simon ******************************************************************************************************************** This message may contain confidential information. If you are not the intended recipient please inform the sender that you have received the message in error before deleting it. Please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful. Thank you for your co-operation. NHSmail is the secure email and directory service available for all NHS staff in England and Scotland NHSmail is approved for exchanging patient data and other sensitive information with NHSmail and GSI recipients NHSmail provides an email address for your career in the NHS and can be accessed anywhere For more information and to find out how you can switch, visit www.connectingforhealth.nhs.uk/nhsmail ********************************************************************************************************************