COHERENT manpages
This page displays the COHERENT manpage for aliases [File of users' aliases].
List of available manpages
Index
aliases -- System Administration
File of users' aliases
/usr/lib/mail/aliases
File /usr/lib/mail/aliases holds aliases for users' addresses -- either on
your system, or on other systems. The command smail reads this file when
it figures out how to deliver a mail message.
An alias is a ``nickname'' for a user. Once you have established an alias
for a user, you can use that alias to send mail to her; this spares you the
trouble of typing that person's convoluted e-mail address. An alias can
also name an entire group of users; when you use the alias to send a mail
message, every person in the group receives a copy.
The format of each alias is
alias_name: target
where alias_name gives the alias to which you mail your message, and target
is name to which where smail actually directs the message. target can be a
login identifier on your local system; a mail address of a user on another
system; or a cluster of users either on your system or on remote systems.
For example, consider the user whose e-mail address is
ivan@lepanto.mwc.com. If you add the entry
ivan: ivan@lepanto.mwc.com
to file /usr/lib/mail/aliases, then whenever you send mail to ivan, the
routing program smail will automatically ``expand'' the address from ivan
to ivan@lepanto.mwc.com, and dispatch the message properly. This spares
you needless work, and eliminates the errors that would occur if you typed
long addresses by hand.
Please note that smail ignores differences in case when it compares a name
with an alias. If a line begins with a white-space character, smail
assumes that that line is a continuation of the previous line. smail
ignores strings within parentheses, as well as any text that appears after
the pound sign `#'. Thus, you can use `#' to embed a comment within
aliases.
Examples
The following gives an example form of aliases:
# this whole line is a comment
# "mail programmers" sends mail to local users joe, jack, and bill
programmers: joe jack bill
# same as above
programmers: joe jack
bill
# same as above
programmers joe jack
bill
# same as above
programmers joe # Joe Smith
jack # Jack Thomas
bill # Bill Williams
# and yet another way; note use of parentheses to comment text
programmers joe (Joe Smith) jack (Jack Thomas)
bill (Bill Williams)
# send a message to someone on another system.
# this uses ``bang-path'' addressing
joe: boston!widget!js
# send a message to users on both your and another system
programmers: boston!widget!js # Joe Smith
chicago!gadget!jt # Jack Thomas
bill # Bill Williams
# all members of "programmers" group work at site "widget"
programmers!widget joe jack bill
To tell smail to use the contents of another file to expand an alias, use
the following form:
fredlist :include:/usr/lib/mail/fredlist
smail adds each entry in /usr/lib/mail/fredlist to the alias for fredlist.
You can also tell smail to read another alias file, and include its
contents in the list of aliases to be expanded. For example, the following
instruction
:include:/usr/lib/mail/morealiases
when embedded within /usr/lib/mail/aliases, tells smail to add the contents
of /usr/lib/mail/morealiases to those of /usr/lib/mail/aliases as a regular
alias file.
All aliases are recursive, so you must be careful when you define them.
For example, the entries
bill: joe
joe: bill
causes an infinite loop. smail attempts to detect infinite loops, and to
guess what you intended to do. The following example illustrates how you
can use an alias to deliver mail to a remote user as well as to a local
user who has the same name as the alias being expanded. smail expands the
alias
mylogin: mypc!mylogin mylogin
to
mypc!mylogin mylogin
even though the second occurrence of mylogin matches the alias name.
Both forms of file inclusion are recursive, too, and may lead to infinite
loops if handled carelessly.
See Also
Administering COHERENT,
mail [overview],
smail
Notes
Beginning with release 4.2.14 of COHERENT, smail's aliases are kept in the
form of a DBM data base. This is a simple data base that uses a hash table
to speed the retrieval of information. If you change your file of aliases,
you must invoke either the command newaliases or the command smail -bi to
rebuild the binary data base of aliases. For details on what a DBM data
base is, see the Lexicon entry for libgdbm. For details on how to use
newaliases or smail, see their respective entries in the Lexicon.




