5 .\" include the -mh macro file
8 .TH MH-ALIAS %manext5% MH.6.8 [%nmhversion%]
10 mh-alias \- alias file for nmh message system
17 This describes both \fInmh\fR personal alias files and
18 the global alias file for nmh mail delivery, the file
22 It does \fBnot\fR describe aliases files used by the message transport system.
23 Each line of the alias file has the format:
25 alias : address\-group
29 alias ; address\-group
42 address\-group := address\-list
46 | \*(lq=\*(rq UNIX\-group
48 | \*(lq+\*(rq UNIX\-group
53 address\-list := address
55 | address\-list, address
58 Continuation lines in alias files end with `\\' followed by the newline
61 Alias\-file and file are UNIX file names. UNIX\-group is a group name
62 (or number) from \fI/etc/group\fR. An address is a \*(lqsimple\*(rq
63 Internet\-style address. Througout this file, case is ignored, except
64 for alias\-file names.
66 If the line starts with a `<', then the file named after the `<' is
67 read for more alias definitions. The reading is done recursively, so a
68 `<' may occur in the beginning of an alias file with the expected results.
70 If the address\-group starts with a `<', then the file named after the
71 `<' is read and its contents are added to the address\-list for the alias.
73 If the address\-group starts with an `=', then the file \fI/etc/group\fR
74 is consulted for the UNIX\-group named after the `='. Each login name
75 occurring as a member of the group is added to the address\-list for
78 In contrast, if the address\-group starts with a `+', then the file
79 \fI/etc/group\fR is consulted to determine the group\-id of the
80 UNIX\-group named after the `+'. Each login name occurring in the
81 \fI/etc/passwd\fR file whose group\-id is indicated by this group is
82 added to the address\-list for the alias.
84 If the address\-group is simply `*', then the file \fI/etc/passwd\fR is
85 consulted and all login names with a userid greater than some magic number
86 (usually 200) are added to the address\-list for the alias.
88 In match, a trailing * on an alias will match just about anything
89 appropriate. (See example below.)
91 An approximation of the way aliases are resolved at posting time is
92 (it's not really done this way):
95 1) Build a list of all addresses from the message to be delivered,
96 eliminating duplicate addresses.
98 2) If this draft originated on the local host, then for those addresses in
99 the message that have no host specified, perform alias resolution.
101 3) For each line in the alias file, compare \*(lqalias\*(rq against all of
102 the existing addresses. If a match, remove the matched \*(lqalias\*(rq
103 from the address list, and add each new address in the address\-group to
104 the address list if it is not already on the list. The alias itself is
105 not usually output, rather the address\-group that the alias maps to is
106 output instead. If \*(lqalias\*(rq is terminated with a `;' instead of
107 a `:', then both the \*(lqalias\*(rq and the address are output in the
108 correct format. (This makes replies possible since \fInmh\fR aliases
109 and personal aliases are unknown to the mail transport system.)
112 Since the alias file is read line by line, forward references work, but
113 backward references are not recognized, thus, there is no recursion.
119 <%etcdir%/BBoardAliases
120 sgroup: fred, fear, freida
121 b-people: Blind List: bill, betty;
123 UNIX\-committee: <unix.aliases
131 The first line says that more aliases should immediately be read from
132 the file \fI%etcdir%/BBoardAliases\fR. Following this, \*(lqfred\*(rq
133 is defined as an alias for \*(lqfrated@UCI\*(rq, and \*(lqsgroup\*(rq
134 is defined as an alias for the three names \*(lqfrated@UCI\*(rq,
135 \*(rqfear\*(rq, and \*(rqfreida\*(rq.
137 The alias \*(lqb-people\*(rq is a blind list which includes the addresses
138 \*(lqbill\*(rq and \*(lqbetty\*(rq; the message will be delieved to those
139 addresses, but the message header will show only \*(lqBlind List: ;\*(rq
142 Next, the definition of \*(lqUNIX\-committee\*(rq is given by
143 reading the file \fIunix.aliases\fR in the users \fInmh\fR directory,
144 \*(lqstaff\*(rq is defined as all users who are listed as members of the
145 group \*(lqstaff\*(rq in the \fI/etc/group\fR file, and \*(lqwheels\*(rq
146 is defined as all users whose group\-id in \fI/etc/passwd\fR is equivalent
147 to the \*(lqwheel\*(rq group.
149 Finally, \*(lqeveryone\*(rq is defined as all users with a user\-id
150 in \fI/etc/passwd\fR greater than 200, and all aliases of the form
151 \*(lqnews.<anything>\*(rq are defined to be \*(lqnews\*(rq.
153 The key thing to understand about aliasing in \fInmh\fR is that aliases
154 in \fInmh\fR alias files are expanded into the headers of messages posted.
155 This aliasing occurs first, at posting time, without the knowledge of the
156 message transport system. In contrast, once the message transport system
157 is given a message to deliver to a list of addresses, for each address
158 that appears to be local, a system\-wide alias file is consulted. These
159 aliases are \fBNOT\fR expanded into the headers of messages delivered.
161 To use aliasing in \fInmh\fR quickly, do the following:
164 First, in your \fI\&.mh\(ruprofile\fR, choose a name for your alias
165 file, say \*(lqaliases\*(rq, and add the line:
170 .\" ali: \-alias aliases
171 .\" send: \-alias aliases
172 .\" whom: \-alias aliases
176 Second, create the file \*(lqaliases\*(rq in your \fInmh\fR directory.
178 Third, start adding aliases to your \*(lqaliases\*(rq file as appropriate.
181 ^%etcdir%/MailAliases~^global nmh alias file
183 ^Aliasfile:~^For a default alias file
185 ali(1), send(1), whom(1), group(5), passwd(5), conflict(8), post(8)
191 Although the forward-referencing semantics of \fImh\-alias\fR files
192 prevent recursion, the \*(lq<\ alias\-file\*(rq command may defeat this.
193 Since the number of file descriptors is finite (and very limited), such
194 infinite recursion will terminate with a meaningless diagnostic when
195 all the fds are used up.
197 Forward references do not work correctly inside blind lists.