LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   sendmail: How can I prevent localhost.localdomain from appearing in email? (https://www.linuxquestions.org/questions/linux-software-2/sendmail-how-can-i-prevent-localhost-localdomain-from-appearing-in-email-818970/)

non77 07-09-2010 03:57 PM

sendmail: How can I prevent localhost.localdomain from appearing in email?
 
When I send email through sendmail, by using a command such as:

Code:

echo "test" | mail test@gmail.com
This appears in email source:

Quote:

Received: from mydomain.com (localhost.localdomain [127.0.0.1])

Received: (from root@localhost)
How can I prevent this? Ideally it would display:
Quote:

Received: from mydomain.com (mydomain.com [server IP])

Received: (from root@mydomain.com)
I've tried playing around with the sendmail.mc file, but nothing seems to work.

Thanks.

zirias 07-10-2010 01:42 AM

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.

non77 07-10-2010 03:37 PM

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.

bathory 07-10-2010 04:16 PM

Hi,

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

Regards


All times are GMT -5. The time now is 08:15 PM.