I want to be able to have outbound email relayed via an SMTP host (gmail), but using different credentials depending on the local sender.
So if I send mail from local account "foo" to
some...@external-host.com, it might use credentials "
x...@gmail.com/password1", whereas if I sent the same mail from local user "bar" it would use credentials "
y...@gmail.com/password2".
In fact, this is almost identical to what's described in this nice post:
https://cthayer.wordpress.com/2008/10/03/sendmail-smart-host-authenication-by-sender/
The unfortunate part is that in that example, they modify
sendmail.cf directly, rather than
sendmail.mc, so you are always at risk of losing your changes if you rebuild your config.
That link above is from 2008, and most of the useful discussion I've found on the subject is from no later than 2010.
I figured that maybe modern Sendmail supports this better out-of-the-box?
Does anyone on here have experience with something like this?
Worst case, I found LOCAL_CONFIG and LOCAL_NET_CONFIG, which seem to be able to inject raw config rules via the .mc file, so maybe I could use them to avoid editing the .cf file directly, as in that post?
Any suggestions welcome — thanks.
(note: I also posted this over at
https://forums.freebsd.org/threads/61123/, but figured this is probably a better place)