The Alias Database

The alias database exists in two forms. One is a text form, maintained in the file /etc/aliases. The aliases are of the form

name: name1, name2, ...
Only local names may be aliased; e.g.,
eric@prep.ai.MIT.EDU: eric@CS.Berkeley.EDU
will not have the desired effect (except on prep.ai.MIT.EDU, and they probably don't want me)[7]. Aliases may be continued by starting any continuation lines with a space or a tab. Blank lines and lines beginning with a sharp sign ( #) are comments.

The second form is processed by the ndbm(3)\** or db(3) library. This form is in the files /etc/aliases.dir and /etc/aliases.pag. This is the form that sendmail actually uses to resolve aliases. This technique is used to improve performance.

The control of search order is actually set by the service switch. Essentially, the entry

OAswitch:aliases
is always added as the first alias entry; also, the first alias file name without a class (e.g., without nis: on the front) will be used as the name of the file for a ``files'' entry in the aliases switch. For example, if the configuration file contains
OA/etc/aliases
and the service switch contains
aliases nis files nisplus
then aliases will first be searched in the NIS database, then in /etc/aliases, then in the NIS+ database.

You can also use alias files. For example, the specification:

OA/etc/aliases
OAnis:mail.aliases@my.nis.domain
will first search the /etc/aliases file and then the map named mail.aliases in my.nis.domain. Warning: if you build your own alias files, be sure to provide the -l flag to makedbm(8) to map upper case letters in the keys to lower case; otherwise, aliases with upper case letters in their names won't match incoming addresses.

Additional flags can be added after the colon exactly like a K line -- for example:

OAnis:-N mail.aliases@my.nis.domain
will search the appropriate NIS map and always include null bytes in the key.


[Contents] [Previous] [Next]


Questions or problems regarding this web site should be directed to Steve Gielda.
Copyright 1999 www.cotse.com.  All rights reserved.
Last modified: Friday April 02, 1999.