Posts Tagged Postfix identity

Identity for Postfix

Posted by Filed Under Installation with Comments Off

Identity

The Postfix mail server has 4 major identity features that will need to be considered. These identity features are very important in terms how the server is able to communicate on the Internet because it is so closely tied to DNS, just like all mail servers.

myhostname

Postfix requires a fully qualified domain name or FQDN. A FQDN includes the hostname of the server as well as the domain name like this:

mail.example.org

This includes the hostname “mail” and the domain name “example.org”.

The command hostname will give you the hostname for the server. It is important that this be a canonical name, in other words if the server hostname is mail and the domain is example.org the canonical hostname would be mail.example.org.

To find the hostname of the server type this command:

hostname

To change the hostname of the server add the hostname after the command:

hostname mail.example.org

Hostname is important for Postfix because it uses a parameter myhostname which in turn determines a parameter mydomain. These are two necessary parameters for starting Postfix.

Creating a Fully Qualified Domain Name
Postfix provides a utility that enables you to change the hostname into a FQDN. Use the command postconf with the -e option for editing Here is an example:

postconf -e myhostname=mail.example.org

Setting myhostname is important because a Fully Qualified Domain Name will also change the setting for mydomain. If your FQDN is mail.bigstrike.org then the parameter form mydomain is automatically example.org.


Example: Consequences of Incorrect Hostname

postfix reload
postfix: warning: My hostname admin131 is not a fully qualified name - set myhostname or    mydomain in /etc/postfix/main.cf
postfix/postfix-script: warning: My hostname admin131 is not a fully qualified name - set  myhostname or mydomain in /etc/postfix/main.cf
postfix/postfix-script: fatal: the Postfix mail system is not running

mydomain

The mydomain parameter requires the domain name only. Postfix can determine the hostname and add it to domain name if mydomain is set. This then will allow Postfix to function.

myorigin

This parameter is a way for Postfix to set a domain name when the user sends an email and no domain name is specified in the envelope or header address. The default value of myorigin is the value of myhostname, again another reason myhostname is important to set up.

Here is how this all works. If the myhostname is:

mail.example.org

And if the user who sends mail is mike, then the resulting mail return address is: mike@mail.example.org

username@myhostname(FQDN)

If users do not want the hostname of the server in the return address then set the myorigin to this parameter:

myorigin = $mydomain

Now using the example above the return address for the user mike will be:

mike@example.org

username@domain

The last example is usually what people like.

mydestination

This important parameter sets the domains that Postfix will accept mail for. The default setting allows Postfix to accept mail for $myhostname and localhost.$mydomain. These two settings only allow mail to the mail server, not a domain. So, to accept mail for the whole domain, add the $mydomain. Remember, you can add multiple values on the same line when you enter information for a parameter.

mydestination = $myhostname, localhost.$mydomain, $mydomain


Copyright CyberMontana Inc. and Postfixmail.com
All rights reserved. Cannot be reproduced without written permission. Box 1262 Trout Creek, MT 59874