I am running sendmail 8.15 on an Ubuntu 18.04 LTS server that is relaying emails from other internal and external mailservers and relays their emails as a smarthost to the internet. Even if some header fields may not be RFC compliant, I want to relay those emails without any modifications of the header adresses.
Problem: Sendmail by default always masquerades header-from, header-to and header-cc addresses and replaces empty domains and localhost with its own FQDN.
Original email headers when delivering at port 25:
From: me
To: me@localhost
Email headers after passing sendmail:
From: me@myhost.mydomain.com
To: me@myhost.mydomain.com
Expected headers after passing sendmail:
From: me
To: me@localhost
What I have tried before in my sendmail.mc:
- FEATURE(limited_masquerade): seems to not change anything
- MASQUERADE_AS(`example.org'): results in missing domains getting replaced by me@example.org, but localhost still gets replaced by the servers FQDN
- MASQUERADE_DOMAIN(`myhost.mydomain.com'): in my understanding, this should make sendmail to not masquerade anything except 'myhost.mydomain.com', but that din't help either.
Is there any way to completely disable the masquerade feature of sendmail?
It would be also okay, to set some random config values, such that missing domains and 'me@localhost' will not be touched.