Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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 or alternatively

share|improve this answer

Your Answer


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.