[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
System Management Guide: Communications and Networks

Managing Mail Aliases

Aliases map names to address lists using personal, systemwide, and domainwide alias files. You can define three types of aliases:

personal Defined by individual users in the user's $HOME/.mailrc file.
local system Defined by the mail system administrator in the /etc/aliases file. These aliases apply to mail handled by the sendmail command on the local system. Local system aliases rarely need to be changed.
domainwide Aliases are found using the Network Information Service (NIS). (NIS must be configured and the O AliasFile option must be set in the sendmail.cf file.) To enable use of the NIS aliases mapping:
  1. Uncomment O AliasFile in the sendmail.cf file and specify the map name for NIS aliases.

  2. Recompile the sendmail.cf file with the command sendmail -bz.

  3. Recompile the alias database with the command sendmail -bi.

If you use a domain hierarchy for NIS+, you may need one mail host for each domain in the namespace because names in separate domains may no longer be unique. For more information about NIS and NIS+ requirements, see AIX Version 4.3 Network Information Services (NIS and NIS+) Guide.

/etc/aliases File

The /etc/aliases file consists of a series of entries in the following format:

Alias: Name1, Name2, ... NameX 

where Alias can be any alphanumeric string that you choose (not including special characters, such as @ or !). Name1 through NameX is a series of one or more recipient names. The list of names can span one or more lines. Each continued line begins with a space or a tab. Blank lines and lines beginning with a # (pound sign) are comment lines.

The /etc/aliases file must contain the following three aliases:

MAILER-DAEMON The ID of the user who is to receive messages addressed to the mailer daemon. This name is initially assigned to the root user:
MAILER-DAEMON: root
postmaster The ID of the user responsible for the operation of the local mail system. The postmaster alias defines a single mailbox address that is valid at each system in a network. This address enables users to send inquiries to the postmaster alias at any system, without knowing the correct address of any user at that system. This name is initially assigned to the root user:
postmaster: root
nobody The ID that is to receive messages directed to programs such as news and msgs. This name is initially assigned to /dev/null:
nobody: /dev/null

To receive these messages, define this alias to be a valid user.

Any time you change this file, you must recompile it into a database format that the sendmail command can use. See Building the Alias Database .

Creating Local System Aliases for Mail

To create or modify local system aliases:

  1. Edit the /etc/aliases file using your favorite editor.

  2. On a blank line, add an alias, followed by a colon (:), followed by a list of comma-separated recipients. For example, the following entry defines the writers alias to be the names of people in that group:
    writers: geo, mark@zeus, ctw@athena, brian
    This definition could also be contained on several lines, as long as each added line begins with a space or a tab, for example:
    writers: geo,
          mark@zeus,
          ctw@athena,
          brian
  3. Create an owner for any distribution list aliases. If the sendmail command has trouble sending mail to the distribution list, it sends an error message to the owner of that list. For example, the following set of entries in the /etc/aliases file defines a distribution list named editors, whose owner is glenda@hera:
    editors: glenda@hera, davidm@kronos, perryw@athena
    owner-editors: glenda@hera
  4. Recompile the /etc/aliases file by following the instructions in the section, "Building the Alias Database".

Building the Alias Database

The sendmail command does not use directly the alias definitions in the local system /etc/aliases file. Instead, the sendmail command reads a processed database manager (dbm) version of the /etc/aliases file. You can compile the alias database using one of the following methods:

Notes:
  1. If these files do not exist, the sendmail command cannot process mail and will generate an error message.
  2. If you have multiple alias databases specified, the -bi flag rebuilds all the database types it understands (for example, it can rebuild Network Database Management (NDBM) databases but not NIS databases).

The /etc/netsvc.conf file contains the ordering of system services. To specify the service ordering of aliases, add the following line:

aliases=service, service

where service can be either files or nis. For example:

aliases=files, nis

tells the sendmail command to try the local alias file first; and if that fails, try nis. If nis is defined as a service, it should be running.

For further information on the /etc/netsvc.conf file, see AIX Version 4.3 Files Reference.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]