Archive for the Installation Category

Postfix Check Configuration

Posted by Filed Under Installation with Comments Off

Checking Postfix

Postfix provides a tool that will check the configuration and function of the program. The tool has a simple command that if it does not have any output then the check is successful.

postfix check

If you do receive output then you will need to correct any problems.  Another good place to look for problems is the /var/log/maillog (CentOS) or /var/log/messages.


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

Postifx Aliases File

Posted by Filed Under Installation with Comments Off

Aliases

It is important for Postfix to be able to use the alias file on the server (/etc/aliases). To ensure that it is in a format that Postfx can use run the newaliases command.

newaliases

or run this command

postalias

The alias file is created in a database that can be used both by Sendmail and Postfix. This has been done so that if you migrate from a Sendmail installation you will be able to move easily to Postfix and use the same aliases. The alias database is designated by the alias_maps parameter.

An important point to note is that the alias file is system dependent. That means that you will need to know the type of database that is used by the alias file as well as the location of the file. Postfix makes this easier for you by listing the options which are typical. Just uncomment the correct option. CentOS, Suse and RHEL will use the hash database and place it in /etc/aliases. The Postfix example is listed below.

#alias_maps = dbm:/etc/aliases
alias_maps = hash:/etc/aliases
#alias_maps = hash:/etc/aliases, nis:mail.aliases
#alias_maps = netinfo:/aliases

The alias_database parameter specifies the alias database that is built with the newaliaeses command. This configuration is separate from the alias_maps because the two may be different and alias_maps may be controlled by another program.

#alias_database = dbm:/etc/aliases
#alias_database = dbm:/etc/mail/aliases
alias_database = hash:/etc/aliases
#alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases

How an Alias is Used

When you create an alias you are converting mail from one user to another user account. This method may be used to create an alias for one user or for an email list.

Here is a look at a default /etc/aliases file: (Note this file may vary with distro but concepts are similar)

#
#  Aliases in this file will NOT be expanded in the header from
#  Mail, but WILL be visible over networks or from /bin/mail.
#
#       >>>>>>>>>>      The program "newaliases" must be run after
#       >> NOTE >>      this file is updated for any changes to
#       >>>>>>>>>>      show through to sendmail.
#

# Basic system aliases -- these MUST be present.
mailer-daemon:  postmaster
postmaster:     root

# General redirections for pseudo accounts.
bin:            root
daemon:         root
ad m:           root
lp:             root
sync:           root
shutdown:       root
halt:           root
mail:           root
news:           root
uucp:           root
operator:       root
games:          root
gopher:         root
ftp:            root
nobody:         root
radiusd:        root
nut:            root
dbus:           root
vcsa:           root
canna:          root
wnn:            root
rpm:            root
nscd:           root
pcap:           root
apache:         root
webalizer:      root
dovecot:        root
fax:            root
quagga:         root
radvd:          root
pvm:            root
amanda:         root
privoxy:        root
ident:          root
named:          root
xfs:            root
gdm:            root
mailnull:       root
postgres:       root
sshd:           root
smmsp:          root
postfix:        root
netdump:        root

The alias file may contain several kinds of alias forms. Each form is followed by a colon.

Mary_Thompson:                  mary

The name Mary_Thompson was converted to the local user mary.

tech:                                           mary,john,fred

Here by sending an email to tech it actually sends to three users who are involved in tech.

tech_users:                     :include:   /usr/local/techlist

This email will convert to a list of users that was created in the techlist.

nobody:                                 /dev/null

This email nobody will send all mail to trash.

edit:                           ¨|/usr/local/bin/edit¨

This email will actually send the email to interact with a program. Notice the pipe symbol which sends the email to the edit program.

Mike:                           mike@somewhereelse.com

This allows you to send mail send to mike@bigstrike.org to mike@somewherelese.com

Note that names are not case-sensitive.

Once you have edited this file you need to rebuild that alias database with this command:

newaliases

This tells the system and Postfix to rebuild the alias database.


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

Postfix Network Configuration

Posted by Filed Under Installation with Comments Off

Changes Necessary for Network Connections

Just like Sendmail, Postfix will not accept connections from other computers until you take a few steps to enable it. There are several lines that must be uncommented and then your configuration placed in it. The example will assume that your domain is example.org and the FQDM is mail.example.org. Be sure to put in the correct network for your settings.

mydomain = example.org
myorigin = $mydomain
myhostname = mail.example.org
mydestination = $myhostname, localhost, localhost.$mydomain
mynetworks = 192.168.3.0/24
inet_interfaces = all

The restart Postfix.

service postfix restart

.org and the FQDM is mail.example.org. Be sure to put in the correct network for your settings.

mydomain = example.org
myorigin = $mydomain
myhostname = mail.
example.org
mydestination = $myhostname, localhost, localhost.$mydomain
mynetworks = 192.168.3.0/24
inet_interfaces = all

The restart Postfix.

service postfix restart


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

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