Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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: root@mail.example.com

I want mail just being sent from root@example.com, however when I change this section:

myhostname              = mail.example.com 
mydomain                = example.com


myhostname              = example.com 
mydomain                = example.com

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

2 Answers 2

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 root@example.com rather than root@mail.example.com, you have to edit the main.cf 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.