So, I am needing some help with some headers checks I am doing on my postfix mail server . . .
It is my understanding that header checks are processed line by line, but I am seeing some behavior that makes me question that. I am wanting postfix to allow a message to be delivered if it is sent to a specific user and not be rejected. I want emails to all other recipients to be blocked if they aren’t encrypted. For example, line #1 in my header_checks file uses /^To: someaddr...@mydomain.com <mailto:someaddr...@mydomain.com>/ PASS This email can skip further header checks since it is destined for the correct address. And line #2 in header_check is /^Content-Type: text\/plain/ REJECT The above lines seem to work fine if the “To:” header comes before the “Content-Type” header in the email being sent, but if the “Content-Type” header comes before the “To” header in the email it gets rejected. Why would that be? I would have thought that the order of the email headers themselves doesn’t matter. It seems like Mac Mail is putting the “Content-Type” header before the “To” header in the email. Any ideas or suggestions for me?