Sendmail SMART_HOST different credentials by sender

I want to be able to have outbound email relayed via a SMTP host (gmail), but using different credentials depending on the local sender.

So if I send mail from local account "foo" to somebody@external-host.com, it might use credentials "xxx@gmail.com/password1", whereas if I sent the same mail from local user "bar" it would use credentials "yyy@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 it modifies 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.
 
Back
Top