I have a host with multiple domain names: thishost.com, thathost.com. My sendmail.mc file has:
I originally had this setting before adding thathost.com, mainly to prevent the hostname from showing up in the From: address. e.g. email@example.com instead of firstname.lastname@example.org. However, when I added thathost.com to /etc/mail/local-host-names and the line
to the /etc/virtusertable, I cannot send mail addressed from users on thathost.com. The domain always gets changed to thishost.com. E.g. a message sent by email@example.com gets sent as From: firstname.lastname@example.org.
I suspect the way to fix this is to remove the MASQUERADE_AS directives in sendmail.mc, but I'd like some confirmation from a expert before I start experimenting.