On 10/3/2013 12:49 PM, Philip Garrett wrote: > I have a special-purpose Postfix 2.6 server that is part of a content > conversion system. I would like to quarantine any outbound mail that hasn't > been transformed properly. I'd also like to quarantine relay mail that hasn't > gone through the reciprocal transformation. > > I can hold the mail using mime_header_checks, but this would apply to both > outbound (default domain class) and inbound (relay domain class). What I > really want to do is something like this: > > if DEFAULT_DOMAIN_CLASS > if /^Content-Type:/ > !/^Content-Type:\s*application\/x-my-custom-format/ > HOLD was not encoded > endif > endif > > if RELAY_DOMAIN_CLASS > if /^Content-Type:/ > /^Content-Type:\s*application\/x-my-custom-format/ > HOLD was not decoded > endif > endif > > Is there a way to accomplish that? > > Thanks, > Philip >
header (and body) checks evaluate a single header (or line) at a time with no state saved in between, so you can't combine multiple conditions. One possible solution is using separate postfix instances for incoming and outgoing mail, effectively splitting the mail flow into domain classes before the mime_header_checks see the message. http://www.postfix.org/MULTI_INSTANCE_README.html Alternately, a custom perl or python milter should be able to do this. http://www.postfix.org/MILTER_README.html -- Noel Jones