Michael Donovan:
> What I want is for Postfix to NOT send the mail [when the sender
> does not match sender_dependent_relayhost_maps] at all. Instead
> immediately bounce it back to user3 as undeliverable.
This is easier with sender_dependent_default_transport_maps:
What follows is untested, and may not work if you also have other
transport overrides in place such as transport_maps or relayhost
settings.
/etc/postfix/main.cf:
default_transport = error:you can't go there from here
sender_dependent_default_transport_maps = hash:/etc/postfix/sender_relay
/etc/postfix/sender_relay:
[email protected] smtp:relayhost-for-joe
[email protected] smtp:relayhost-for-jane
Of course this means that any mail from outside that can't be
delivered will be lost (the notification has a null sender which
won't match your table).
To avoid loss of bounces you turn on double-bounce notification:
/etc/postfix/main.cf:
notify_classes = resource, software, 2bounce
The priority order of Postfix routing is hard-coded (i.e. still to
be made configurable) and the documentation is kind-of obscure.
Read carefully.
Wietse