How to set the hostname of a postfix mail server?

In a VPS with Ubuntu 12.04 LTS, I have installed postfix. The domain name is example.com, the VPS hostname is server.example.com. For the domain example.com I create an MX record. After that a mail server mail.example.com is up and running.

How to in postfix configuration main.cf set myhostname?

myhostname=server.example.com

OR

myhostname=mail.example.com

Answer

The hostname is really the name of your VPS host. The name in your MX record goes into mydomain.

myhostname=server.example.com
mydomain=mail.example.com # if you receive emails as me@mail.example.com, or mydomain=example.com if you receive emails as me@example.com

Attribution
Source : Link , Question Author : ptheo , Answer Author : Calimo

Leave a Comment