Avatar of Mark
Mark

asked on 

How to keep virtual domain name on outgoing sendmail

I have a host with multiple domain names: thishost.com, thathost.com. My sendmail.mc file has:

MASQUERADE_AS(`thishost.com')
FEATURE(`masquerade_envelope')
FEATURE(`masquerade_entire_domain')

I originally had this setting before adding thathost.com, mainly to prevent the hostname from showing up in the From:  address. e.g. myuser@thishost.com instead of myuser@server.thishost.com.  However, when I added thathost.com to /etc/mail/local-host-names and the line

thisuser@thathost.com          thisuser

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 thatuser@thathost.com gets sent as From: thatuser@thishost.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.
LinuxEmail Servers

Avatar of undefined
Last Comment
Sandy

8/22/2022 - Mon