How to keep virtual domain name on outgoing sendmail
Posted on 2013-11-29
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. firstname.lastname@example.org instead of email@example.com. 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 firstname.lastname@example.org gets sent as From: email@example.com.
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.