Sendmail Masquerading
I got tired of having my sendmail server send mail from user@Pulsar.NotLlamabyte.com instead of user@NotLlamabyte.com. I went on to research how to change this. I found sendmail masquerading that would do exactly what I wanted.
Masquerading
I figured out that I can just masquerade as NotLlamabyte.com which would leave out the hostname. This feature allows multiple hosts to send mail from the same domain name. In my case, I only have the one host, but I still want it to be from my real domain name and not host.domainName.
Configuring
All it took was a few lines in my sendmail.mc file.
/etc/mail/sendmail.mc
MASQUERADE_AS(NotLlamabyte.com)dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
MASQUERADE_DOMAIN(NotLlamabyte.com)dnl
Save the file, run sendmailconfig to load the new settings, and it’s all set! All the mail sent from my server is now from user@NotLlamabyte.com instead of user@Pulsar.NotLlamabyte.com.
Testing
Simply send an email from your server, and check the reply-to address.
Alternate method
You can configure sendmail to read the masquerade information from an external table file (like the aliases file). This method allows you to support multiple domain names, and have different users masquerade as different hosts. I opted not to do it this way, since I only have the one host.
This is what it would look like had I chosen this route:
/etc/mail/sendmail.mc
FEATURE(genericstable)dnl
FEATURE(generics_entire_domain)dnl
FEATURE(masquerade_envelope)dnl
GENERICS_DOMAIN(`NotLlamabyte.com’)dnl
/etc/mail/genericstable
@Pulsar.NotLlamabyte.com %1@NotLlamabyte.com




