Linux – Sendmail configure masquerade domain

emailemail-serverlinuxsendmail

i'm really new to sendmail and i'm trying to configure it properly as my server mta.
First of all i'm trying to accomplish some easy tasks as for example masquerade the domain name to show the one i need. I mean, i would like the from field of the email to show foo@myDomain.com
In order to do that i first try with the following, but didn't worked:

define(`confDOMAIN_NAME', `myDomain.com')dnl
FEATURE(`relay_entire_domain')dnl

Should this worked?

As it didn't worked for me, then i tried:

MASQUERADE_AS(myDomain.com)dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
MASQUERADE_DOMAIN(myDomain.com)dnl

Last block worked fine, but i still think the first one should have worked.

Could someone point what's the error on the first block?
Should have it worked?
Is the syntax obsolete?
Lastly, could someone tell what's the difference between the first and the last block? Thanks in advanced 🙂

PD: Byusing confMAILER_NAME satement should i be able to set a default user name, i.e. myUser@....

Best Answer

The second block is what you use to masquerade the "from" domain. The first block controls the HELO response of the server. Say the server's actual hostname is host1.abc.net. Configuring define(confDOMAIN_NAME', abc.net')dnl will present the sending server's name as abc.net.