Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to setup postfix so that email lacking a specific email header are rejected.

Is it possible to use header_check to reject emails that do not include a specific header field entry.

The solution that I believe may work is the following:

/^x-tituslabs-classifications-30: (<>)?$/ REJECT Classification field required

I want to make sure that any email going through postfix contains a x-tituslabs-classifications-30 entry.

share|improve this question

1 Answer 1

This does not work. Your solution will reject all mails that have the header.

You can't do it with header_checks because they are only useful to check if an header exists but not if the header is lacking. That's bad but how it works.

You have to setup a mail filter (MILTER) to do that. See the documentation at http://www.postfix.org/MILTER_README.html or alternatively http://www.postfix.org/SMTPD_PROXY_README.html

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.