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