Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-09-2010, 04:57 PM   #1
LQ Newbie
Registered: Jul 2010
Posts: 2

Rep: Reputation: 0
sendmail: How can I prevent localhost.localdomain from appearing in email?

When I send email through sendmail, by using a command such as:

echo "test" | mail
This appears in email source:

Received: from (localhost.localdomain [])

Received: (from root@localhost)
How can I prevent this? Ideally it would display:
Received: from ( [server IP])

Received: (from
I've tried playing around with the file, but nothing seems to work.


Last edited by non77; 07-09-2010 at 05:22 PM.
Old 07-10-2010, 02:42 AM   #2
Registered: Jun 2010
Posts: 361

Rep: Reputation: 59
sendmail is a beast to configure, and as using the machine's hostname is a very reasonable default, if you want to change it, you have to edit and "compile" some macro files. I did that a long time ago, but I get the impression that you don't really WANT to use sendmail in your scenario? Because, if all you want is getting mails off your system with smtp, there are much easier alternatives:

- probably the easiest that does nothing else than forwarding your local system's mail per smtp: ssmtp.
- if you need a little more features, try a lightweight exim build, e.g. on a debian machine: exim4-daemon-light.
Old 07-10-2010, 04:37 PM   #3
LQ Newbie
Registered: Jul 2010
Posts: 2

Original Poster
Rep: Reputation: 0
I just want the ability to send emails from my domain, and not have it marked as spam because of the localhost stuff. I can receive them from somewhere else.
Old 07-10-2010, 05:16 PM   #4
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,902

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611

You should use masquerade. There are lots of tutorials, so search for one that is written for your distro, or take a look at this generic one



localhost, masquerade, sendmail

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
sendmail sending localhost.localdomain unix1adm Linux - Software 13 02-15-2010 08:17 AM
Mail from root@localhost.localdomain thru relay=localhost.localdomain[] rshartog Linux - Server 2 02-02-2009 11:35 PM
sendmail from address is root@localhost.localdomain procfs Linux - Software 9 09-26-2006 11:42 AM
sendmail using localhost.localdomain Linux - Software 1 10-27-2005 06:47 PM
sendmail and @localhost.localdomain deadlock Linux - Networking 4 12-17-2003 09:08 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:22 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration