How do I configure Postfix to send email through a different relayhost based the system user?
The current setup has relayhost= set so all mail goes through that smtp server but I would like Postfix to send directly based on system user.
I'm open to other options that would allow a script to in some way have Postfix override the relayhost.
transport_maps based on recipient domain unfortunately won't work in this case as it's not the recipient domain that determines what relayhost is chosen.
Thanks,
Best Answer
I took a hint from the post Use different relay in postfix and used
header_checks
to assign the proper transport for emails that I had inserted an X-Foo header into:relayhost
was commented out (default) in/etc/postfix/main.cf
but it could've been anything and you'd use theheader_checks
to override it