Friday, October 2, 2009

Episode 14: Sendmail Masquerade

Masquerading is a feature which rewrites the hostname in the address of outbound mails. This feature is usually applied to route the inbound mail from a network through a centralized mail hub. This feature is also applied to hide the actual hostname in order to manage mails to avoid using a busy hostname.


To enable this, add the following lines to the /etc/mail/sendmail.mc file:




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


Update the Sendmail configuration files using the m4 macro processor to generate a new sendmail.cf file by executing the following command:




# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf


To get the Sendmail macro file, the sendmail-cf package must be installed on the system.


After creating a new /etc/mail/sendmail.cf file, restart Sendmail for the changes to take effect. To do this, use the following command:




# service sendmail restart


For more details on the masquerading of Sendmail, use the following links:


•Red Hat Documentation: http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/ref-guide/s1-email-mta.html

•Sendmail - Masquerading and Relaying: http://www.sendmail.org/m4/masquerading.html

No comments:

Post a Comment