If you just need an outgoing email from web server use sendmail. But what is masquerading?
With the help of masquerading your outgoing email appers from user@cyberciti.biz instead of realunixuser@server01.cyberciti.biz. This will also hide your internal user name or host name from rest of the world.
So this feature rewrites the hostname in the address of outgoing mail. This is also used when you have centralized mail server i.e. mail hub.
Sendmail masquerading configuration
Open your sendmail config file /etc/mail/sendmail.mc:
# vi /etc/mail/sendmail.mc
Append/add/modify the lines as follows:
MASQUERADE_AS(cyberciti.biz)dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
MASQUERADE_DOMAIN(cyberciti.biz)dnl
Save and close the file. Replace domain name cyberciti.biz with your actual domain name. Update and restat sendmail server:
# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
# /etc/init.d/sendmail restart
Further reading
- Email this to a friend
- Printable version
- Rss Feed
- Last Updated: Nov/2/2006
{ 4 comments… read them below or add one }
Nice. So, this explains how to ‘hide’ the domain name. But what about the user name ? With the changes you describe, it still shows our real unix username. Am I missing something here ?
thanks for your help.
-Didier
Do you have virtual UNIX user name mapping like:
user1@domain.com drealuser
???
Hi nixcraft,
No I haven’t set this up. To be fully honest, I am not familiar with virtual unix user name mapping. Can you explain a little bit more.
I did try to use the virtusertable file but it didn’t to work for outgoing email. The problem I am trying to solve is EXACTLY the on you mention in your post: I have a machine (prod1) and a user (prod) and I want to send emails as invitation@.com (I am just interested in outgoing email… and no, I am not a spammer :-)
The masquerade works for the domain name, but for the user, I ended up having to create a unix user ‘invitation’ on my box and sudo to invitation before sending the emails… It works fine but I am sure there is a better/simpler way…
Thanks for your reply btw.
-Didier
i m facing the same problem as mentioned by didier , actually i have set a linux monitoring server which monitors network devices,if any device is down it sends emails on our local domain using sendmail, the outgoing mails are sent from this server like root@localhos.localdomain i want to masquerade it to say test@xyz.com, nix and didier any help will be highly appreciable….
thanks