On Tue, Aug 10, 2021 at 10:34:52PM -0400, Matt Corallo wrote:

> I have a need to map some destination domains to a specific smtp
> nexthop, but need to override that nexthop on a sender_dependent
> basis. I've tried a few things and all with no luck:

Sorry, that's not directly possible.  Sender-dependent transport
selection overrides only the *default* transport.  Anything else would
require looking at both the sender and recipient at the same time, and
Postfix does not presently have support for multi-key tables.

> Am I missing something or is there some way to do a custom rewrite
> engine?

It may be possible to rewrite the recipients in question to replace the
domain part with the desired nexthop, so that the default transport
would take care of delivery to the correct nexthop, and this case,
sender-dependent overrides can kick in.  You might then need to reverse
the rewrites via smtp_generic_maps.

Another option is a multi-instance pipeline, in which the recipient
determines the downstream Postfix instance, and then in some special
downstream instances the nexthop in question is the default transport,
and again sender-based overrides can take place.

On Tue, Aug 10, 2021 at 10:43:46PM -0400, Matt Corallo wrote:

> Oh, and if its possible, is it also possible to specify the original
> domains as "any domain with an MX of $REGEX" instead of only "any
> recipient domain of $REGEX"?

No, the queue manager has no access to MX host lookups which happen
during delivery, not transport selection.

-- 
    Viktor.

Reply via email to