Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I’m usually a postfix guy. That’s what I run on my servers and it’s the configuration I understand. So when someone asked me to take a look at an issue on a server running sendmail, I was a bit befuddled.
The problem was that any messages sent from the command line, were arriving with a from address of root@localhost.localdomain. This was a bit of a problem. To test and confirm I ran the following:
view sourceprint?
1
echo "Who will this message be addressed from? The world may never know." | mail -s "Testing sendmail" alex
And sure enough, I get an email address from root@localhost.localdomain. I end up Googling combinations of ‘root@localhost.localdomain’, ‘localhost.localdomain’ and ‘sendmail’. The options were pretty much useless. Too much noise about changing the sendmail configuration options.
In the end, I stumbled upon the real way to fix it….
Open /etc/hosts and change add the host’s name before the localhost.localdomain entry on the first line.
Turns out, sendmail looks for the first hostname in the hosts file for the loopback address and uses that in the from field when a from address isn’t specified by the mail client.
Last edited by JJJCR; 12-16-2013 at 11:50 PM.
Reason: edit
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.