1

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.

Chris Davies
  • 116,213
  • 16
  • 160
  • 287
  • I am running an up-to-date version of Ubuntu 18.04 LTS. – andreas5232 Oct 25 '19 at 13:27
  • no-domain and localhost are special. Sendmail rewrites them to valid-on-other-hosts form. Does sendmail rewrite address with valid domains? – AnFi Oct 25 '19 at 15:10
  • No, other valid domains are not getting rewritten. The problem only exists with the two special cases no-domain and localhost. – andreas5232 Oct 25 '19 at 15:23

0 Answers0