On 6/8/2010 8:08 AM, Ockleford Paul (NHS Connecting for Health) wrote:
I could, but where as you may use a piece of code or an expression you don't 
fully understand I wouldn't. I would rather use tax payers money getting a 
working solution I understand than copy and pasting some crap someone online 
wrote which as they state is UNTESTED.

Thanks all the same

Negative matching is tricky. Mime header checks apply to all mime headers one at a time. So something like
!/foo: x-foo/  REJECT
that will always trigger when postfix evaluates the bar: header. Wietse's example using IF/ENDIF avoids that problem by only checking the foo: header.

Similarly, there is no regexp syntax that works reliably for a missing header. Regexp works on matches and negative matches; there is no syntax for 'not found'.

The end result is you cannot use mime_header_checks to reject mail that does not contain a specific attachment type. Wietse's example of rejecting mail with an attachment, but the wrong type of attachment, is the closest you can get.

If you need further explanation there are ample online resources for regular expression writing, and many peer-reviewed and tested examples in the postfix-users archives.

I'm either a computer professional with years of postfix experience or a 12-year-old on summer holiday. You can either take the advice given you or do your own research. or both.

and while I've never met anyone named Wietse, I seem to remember seeing that name in the postfix copyright statement. His advice might be worth paying attention to.


  -- Noel Jones

Reply via email to