I tried variations of this but never could get it to work - as far as I could tell the nexthop is fully resolved by the time we get to the smtp daemon, so there aren't any relevant settings to override or otherwise set the default on the nexthop there.

Thanks,
Matt

On 8/11/21 17:37, Wietse Venema wrote:
Matt Corallo:


On 8/11/21 16:52, Wietse Venema wrote:
  > If the sender address can override the routing, even if the recipient
  > would otherwise be delivered locally, then that would be a recipe
  > for mailer loops with the potential for mail explosions. This is
  > why we have sender_dependent overrides for default transports and
  > relay hosts, and avoid such stability problems.

Ah! Understood, indeed, the setup I've had to fall back to has some risk of 
routing loops, though with some care to
hopefully ensure it can't ever actually be hit. I guess the only solution is 
multi-key lookups, which would be nice, but
understood that its likely very nontrivial to add :).

Would this do the job:

/etc/postfix/main.cf:
     smtpd_sender_restrictions = hash:/etc/postfix/sender_access

/etc/postfix/sender_access
     example.com  filter smtp-example-com:relay-for-example-com
        ...

/etc/postfix/master.cf:
     smtp-example-com   ..   ..   ..   ..   ..   .. smtp
         ...

It avoids the need for another instance. Postfix should break a
mailer loop that delivers to itself.

         Wietse

Reply via email to