The first alias contained in a blind list is now expanded. The
[mmh] / man / mh-alias.man
1 .\"
2 .\" %nmhwarning%
3 .\"
4 .TH MH-ALIAS %manext5% "%nmhdate%" MH.6.8 [%nmhversion%]
5 .SH NAME
6 mh-alias \- alias file for nmh message system
7 .SH SYNOPSIS
8 any
9 .B nmh
10 command
11 .SH DESCRIPTION
12 This describes both
13 .B nmh
14 personal alias files and
15 the global alias file for
16 .B nmh
17 mail delivery, the file
18 .PP
19 .RS 5
20 %etcdir%/MailAliases
21 .RE
22 .PP
23 It does
24 .B not
25 describe aliases files used by the message transport system.
26 Each line of the alias file has the format:
27 .PP
28 .RS 5
29 .I alias
30 .B :
31 .I address\-group
32 .RE
33 or
34 .RS 5
35 .I alias
36 .B ;
37 .I address\-group
38 .RE
39 or
40 .RS 5
41 .B <
42 .I alias\-file
43 .RE
44 or
45 .RS 5
46 .B ;
47 |
48 .B :
49 |
50 .B #
51 .I comment
52 .RE
53 .PP
54 where:
55 .PP
56 .RS 5
57 .nf
58 .IR address\-group "    := " address\-list
59 .RI "                   |  < " file
60 .RI "                   |  = " UNIX\-group
61 .RI "                   |  + " UNIX\-group
62                         |  *
63
64 .IR address\-list "     := " address
65 .RI "                   |  " address\-list ", " address
66 .fi
67 .RE
68 .PP
69 Continuation lines in alias files end with `\\' followed by the newline
70 character.  This applies to comment lines.  Thus, a line following a
71 comment line that ends with a `\\' will be treated as a continuation of
72 the comment.
73 .PP
74 .RI \*(lq  Alias\-file \*(rq
75 and
76 .RI \*(lq file \*(rq
77 are UNIX file names.
78 .I UNIX\-group
79 is a group name (or number) from
80 .IR /etc/group .
81 An address is a \*(lqsimple\*(rq
82 Internet\-style address.  Througout this file, case is ignored, except
83 for file names.
84 .PP
85 If the line starts with a `<', then the file named after the `<' is
86 read for more alias definitions.  The reading is done recursively, so a
87 `<' may occur in the beginning of an alias file with the expected results.
88 .PP
89 If the
90 .I address\-group
91 starts with a `<', then the file named after the
92 `<' is read and its contents are added to the
93 .I address\-list
94 for the alias.
95 .PP
96 If the
97 .I address\-group
98 starts with an `=', then the file
99 .I /etc/group
100 is consulted for the UNIX\-group named after the `='.  Each login name
101 occurring as a member of the group is added to the
102 .I address\-list
103 for the alias.
104 .PP
105 In contrast, if the
106 .I address\-group
107 starts with a `+', then the file
108 .I /etc/group
109 is consulted to determine the group\-id of the
110 UNIX\-group named after the `+'.  Each login name occurring in the
111 .I /etc/passwd
112 file whose group\-id is indicated by this group is
113 added to the
114 .I address\-list
115 for the alias.
116 .PP
117 If the
118 .I address\-group
119 is simply `*', then the file
120 .I /etc/passwd
121 is consulted and all login names with a userid
122 greater than some magic number (usually 200) are added to the
123 .I address\-list
124 for the alias.
125 .PP
126 In match, a trailing \*(lq*\*(rq on an alias will match just about anything
127 appropriate.  (See example below.)
128 .PP
129 An approximation of the way aliases are resolved at posting time is
130 (it's not really done this way):
131 .PP
132 .RS 2
133 .IP 1) 3
134 Build a list of all addresses from the message to be delivered,
135 eliminating duplicate addresses.
136 .PP
137 .IP 2) 3
138 If this draft originated on the local host, then for those addresses in
139 the message that have no host specified, perform alias resolution.
140 .PP
141 .IP 3) 3
142 For each line in the alias file, compare \*(lqalias\*(rq against all of
143 the existing addresses.  If a match, remove the matched \*(lqalias\*(rq
144 from the address list, and add each new address in the address\-group to
145 the address list if it is not already on the list.  The alias itself is
146 not usually output, rather the address\-group that the alias maps to is
147 output instead.  If \*(lqalias\*(rq is terminated with a `;' instead of
148 a `:', then both the \*(lqalias\*(rq and the address are output in the
149 correct format (with the alias quoted if necessary and the address
150 wrapped in <>).
151
152 This makes replies possible since
153 .B nmh
154 aliases
155 and personal aliases are unknown to the mail transport system.
156 .RE
157 .PP
158 Since the alias file is read line by line, forward references work, but
159 backward references are not recognized, thus, there is no recursion.
160 .PP
161 Example Alias File:
162 .PP
163 .RS 5
164 .nf
165 <%etcdir%/BBoardAliases
166 sgroup: fred, fear, freida
167 b-people: Blind List: bill, betty
168 fred: frated@UCI
169 UNIX\-committee: <unix.aliases
170 staff: =staff
171 wheels: +wheel
172 everyone: *
173 news.*: news
174 .fi
175 .RE
176 .PP
177 The first line says that more aliases should immediately be read from
178 the file
179 .IR %etcdir%/BBoardAliases .
180 Following this, \*(lqfred\*(rq
181 is defined as an alias for \*(lqfrated@UCI\*(rq, and \*(lqsgroup\*(rq
182 is defined as an alias for the three names \*(lqfrated@UCI\*(rq,
183 \*(rqfear\*(rq, and \*(rqfreida\*(rq.
184 .PP
185
186 The alias \*(lqb-people\*(rq is a blind list which includes the addresses
187 \*(lqbill\*(rq and \*(lqbetty\*(rq; the message will be delivered to those
188 addresses, but the message header will show only \*(lqBlind List: ;\*(rq
189 (not the addresses).  The alias must not be terminated with, or contain,
190 a semicolon; see
191 .B Helpful Hints
192 below.  Note that blind lists are not supported with the
193 .B sendmail/pipe
194 mail transport method.
195 .PP
196 Next, the definition of \*(lqUNIX\-committee\*(rq is given by
197 reading the file
198 .I unix.aliases
199 in the users
200 .B nmh
201 directory,
202 \*(lqstaff\*(rq is defined as all users who are listed as members of the
203 group \*(lqstaff\*(rq in the
204 .I /etc/group
205 file, and \*(lqwheels\*(rq
206 is defined as all users whose group\-id in
207 .I /etc/passwd
208 is equivalent to the \*(lqwheel\*(rq group.
209 .PP
210 Finally, \*(lqeveryone\*(rq is defined as all users with a user\-id
211 in
212 .I /etc/passwd
213 greater than 200, and all aliases of the form
214 \*(lqnews.<anything>\*(rq are defined to be \*(lqnews\*(rq.
215 .PP
216 The key thing to understand about aliasing in
217 .B nmh
218 is that aliases in
219 .B nmh
220 alias files are expanded into the headers of messages posted.
221 This aliasing occurs first, at posting time, without the knowledge of the
222 message transport system.  In contrast, once the message transport system
223 is given a message to deliver to a list of addresses, for each address
224 that appears to be local, a system\-wide alias file is consulted.  These
225 aliases are
226 .B NOT
227 expanded into the headers of messages delivered.
228
229 .SH "HELPFUL HINTS"
230 To use aliasing in
231 .B nmh
232 quickly, do the following:
233 .PP
234 .RS 2
235 .IP 1) 3
236 In your
237 .IR \&.mh\(ruprofile ,
238 choose a name for your alias file, say
239 .RI \*(lq aliases \*(rq,
240 and add the line:
241 .PP
242 .RS 5
243 .nf
244 Aliasfile: aliases
245 .\" ali: \-alias aliases
246 .\" send: \-alias aliases
247 .\" whom: \-alias aliases
248 .fi
249 .RE
250 .PP
251 .IP 2) 3
252 Create the file
253 .RI \*(lq aliases \*(rq
254 in your
255 .B nmh
256 directory.
257 .PP
258 .IP 3) 3
259 Start adding aliases to your
260 .RI \*(lq aliases \*(rq
261 file as appropriate.
262 .RE
263 .PP
264 Earlier versions of this man page showed a semicolon at the end of the
265 blind list example.  That caused the preceeding alias to not be
266 expanded.  There must not be a semicolon at the end of, or within, the
267 address group of a blind list.
268 .B post
269 will append the semicolon to the blind list name.
270
271 .SH FILES
272 .fc ^ ~
273 .nf
274 .ta \w'%etcdir%/ExtraBigFileName  'u
275 ^%etcdir%/MailAliases~^global nmh alias file
276 .fi
277
278 .SH "PROFILE COMPONENTS"
279 .fc ^ ~
280 .nf
281 .ta 2.4i
282 .ta \w'ExtraBigProfileName  'u
283 ^Aliasfile:~^For a default alias file
284 .fi
285
286 .SH "SEE ALSO"
287 ali(1), send(1), whom(1), group(5), passwd(5), conflict(8), post(8)
288
289 .SH CONTEXT
290 None
291
292 .SH BUGS
293 Although the forward-referencing semantics of
294 .B mh\-alias
295 files prevent recursion, the
296 .RI \*(lq< " alias\-file" \*(rq
297 command may defeat this.
298 Since the number of file descriptors is finite (and very limited), such
299 infinite recursion will terminate with a meaningless diagnostic when
300 all the fds are used up.