Mail Administration Guide

Setting Up Local Mail Aliases Files

The /etc/mail/aliases file on a local system contains all names by which a system or person is known. The sendmail program uses this file to determine mailing addresses. See the aliases(4) man page.

If your network is not running a name service, the /etc/mail/aliases file of each system should contain entries for all mail clients. You can either edit the file on each system or edit the file on one system and copy it to each of the other systems.

Aliases are of the form:


name: name1, name2, ...

You can create aliases for only local names--a current host name or no host name. For example, an alias entry for user ignatz who has a mailbox on the system saturn would have this entry in the /etc/mail/aliases file:


ignatz: ignatz@saturn

It is a good idea to create an administrative account for each mail server. You do this by assigning root a mailbox on the mail server and adding an entry to the /etc/mail/aliases file for root. For example, if the system saturn is a mailbox server, add the entry root: sysadmin@saturn to the /etc/mail/aliases file.

How to Set Up Local Mail Aliases Files

  1. Compile a list of each of your mail clients and the locations of their mailboxes.

  2. Become root on the mail server.

  3. Edit the /etc/mail/aliases file and make the following entries:

    1. Add an entry for each mail client.

    2. Change the entry Postmaster: root to the mail address of the person who is designated as postmaster.

      See "Setting Up the Postmaster Alias" for more information.

    3. If you have created a mailbox for administration of a mail server, create an entry for root: mailbox@mailserver.

    4. Save the changes.

  4. Type newaliases and press Return.

    This creates an alias file in binary form that sendmail can use. The file is stored in the /etc/mail/aliases.dir and /etc/mail/aliases.pag files.

  5. Copy the /etc/mail/aliases, the /etc/mail/aliases.dir, and /etc/mail/aliases.pag files to each of the other systems.

    When you copy all three files you do not need to run the newaliases command on each of the other systems.

    You can copy the files by using the rcp or rdist commands or by using a script that you create for this purpose. Remember that you must update all the /etc/mail/aliases files each time you add or remove a mail client.