Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Being new to Linux I have followed this tutorial to set up a mail server:

Everything is working correctly however I am sending mail from:

I want mail just being sent from, however when I change this section:

myhostname              = 
mydomain                =


myhostname              = 
mydomain                =

Mail is not received. :(

What is causing this ?

Also, is there a way to change mail being sent from root to another prefix?

Thanks chaps.

share|improve this question
How are you sending the email? – Khaled Feb 5 '13 at 15:00
Through the command line itself. Using mailx. – user155551 Feb 5 '13 at 15:13
up vote 1 down vote accepted

As NickW commented it is not a good idea to remove the fqdn from your hostname. If you are looking for the sender to appear as coming from rather than, you have to edit the config file. The parameter you need to change is myorigin. In your case you can set it to $mydomain. Here is a snippet from postfix documentation.

     myorigin = $myhostname (default: send mail as "user@$myhostname")
     myorigin = $mydomain   (probably desirable: "user@$mydomain")
share|improve this answer
Thanks man :) Worked a treat. – user155551 Feb 5 '13 at 17:17

You cannot remove the FQDN from myhostname, that means the server no longer knows who it is.

The fact that mail sent from the machine directly lists itself as @fqdn is not odd, as it isn't postfix that is deciding that, it's the program sending the mail. The program sending the mail defines the FROM parameter, and the program that is sending root's mail is using your FQDN.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.