How to Use Masquerade functionality of Sendmail in Linux?

With the help of masquerading functionality of sendmail, your outgoing email appears from [email protected] instead of [email protected]. This will also hide your internal user name or host name from rest of the world or unsecured environment.

So this masquerading functionality of sendmail rewrites the hostname in the address of outgoing mail. Sendmail configuration for masquerading is as below:

STEP 1: Open your sendmail config file /etc/mail/

# vim /etc/mail/

Append/add/modify the lines as follows:





Replace domain name with your actual domain name. Save and close the file.

STEP 2: Now generate configuration file from macro file.

# m4 /etc/mail/ > /etc/mail/

# /etc/init.d/sendmail restart