On Thu, Oct 03, 2013 at 01:49:11PM -0400, 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?

Your best bet is a multi-instance configation, with separate inbound
and outbound mail processing.

Mail coming from inside is accepted by the input stage of the
outbound MTA, and if some of the recipients are internal those are
routed to the input stage of the inbound MTA.

Mail coming from outside is accepted by the input stage of the
inbound MTA, and if some of the recipients are external those are
routed to the input stage of the inbound MTA.

Between the input and output stage of each direction is a transparent
proxy performing the desired transformation which is the
default_transport for the corresponding input stage.

    http://www.postfix.org/MULTI_INSTANCE_README.html

You have a recipient-specific policy, but Postfix content filtering
happens at the message level on input, hence you need to "split the
envelope" before filtering, by routing recipients with different
policies via distinct flows.

-- 
        Viktor.

Reply via email to