preload preload preload preload

Postifx Aliases File

Postifx Aliases File

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