This is sendmail 8.13.3 as provided by HP for HP-UX 11.11. I seem to have stumped the HP forums with this question.
Call this machine "hpux.domain.com". The primary mail function is outbound mail, there's very little inbound traffic. Outbound messages can be addressed with an alias or the actual address. I use mailx for testing.
The outside world doesn't know hpux.domain.com, so sender addresses on mail and envelopes to external addresses must appear as so-and-so@domain.com instead of so-and-so@hpux.domain.com. Recipient addresses should be untouched. For that, I added this to sendmail.mc:
MASQUERADE_AS(`domain.com')dnl
MASQUERADE_DOMAIN(`hpux.domain.com')dnl
FEATURE(`masquerade_envelope')dnl
This fixed the sender address on mail sent to an alias which translates to an external address.
But mail sent directly to an external address did NOT have the correct sender address.
So I added those same three lines to to submit.mc. Now mail sent directly to an external address has the correct sender address. But recipient addresses of local users and aliases are being masqueraded as well. e.g.
mailx -s "test" somealias </dev/null
tries to deliver to somealias@domain.com instead of the alias address "somealias". Same thing for someuser - local delivery is broken as well.
I tried this:
FEATURE(`local_no_masquerade')dnl
in both sendmail.mc and submit.mc, but it didn't help. It's as if the `allmasquerade' feature was turned on - but it's not. And there's no directive to turn it off that I can add to submit.mc.
My hope was to make changes only to the .mc files. If I have to go tweak the resulting .cf file, then I might as well not bother with .mc at all and go attack the learning curve for changing .cf files.
I'm reading the .mc documentation at sendmail.org but so far haven't found the magic bullet for this. Anyone?
Call this machine "hpux.domain.com". The primary mail function is outbound mail, there's very little inbound traffic. Outbound messages can be addressed with an alias or the actual address. I use mailx for testing.
The outside world doesn't know hpux.domain.com, so sender addresses on mail and envelopes to external addresses must appear as so-and-so@domain.com instead of so-and-so@hpux.domain.com. Recipient addresses should be untouched. For that, I added this to sendmail.mc:
MASQUERADE_AS(`domain.com')dnl
MASQUERADE_DOMAIN(`hpux.domain.com')dnl
FEATURE(`masquerade_envelope')dnl
This fixed the sender address on mail sent to an alias which translates to an external address.
But mail sent directly to an external address did NOT have the correct sender address.
So I added those same three lines to to submit.mc. Now mail sent directly to an external address has the correct sender address. But recipient addresses of local users and aliases are being masqueraded as well. e.g.
mailx -s "test" somealias </dev/null
tries to deliver to somealias@domain.com instead of the alias address "somealias". Same thing for someuser - local delivery is broken as well.
I tried this:
FEATURE(`local_no_masquerade')dnl
in both sendmail.mc and submit.mc, but it didn't help. It's as if the `allmasquerade' feature was turned on - but it's not. And there's no directive to turn it off that I can add to submit.mc.
My hope was to make changes only to the .mc files. If I have to go tweak the resulting .cf file, then I might as well not bother with .mc at all and go attack the learning curve for changing .cf files.
I'm reading the .mc documentation at sendmail.org but so far haven't found the magic bullet for this. Anyone?