0
|
1 .\" This file is automatically generated. Do not edit!
|
|
2 .\" @(#)$Id$
|
|
3 .SC MH-ALIAS 5
|
|
4 .NA
|
|
5 mh-alias \- alias file for MH message system
|
|
6 .SY
|
|
7 any \fIMH\fR command
|
|
8 .DE
|
|
9 This describes both \fIMH\fR personal alias files and
|
|
10 the (primary) alias file for mail delivery, the file
|
|
11
|
|
12 /usr/local/mh/lib/MailAliases
|
|
13
|
|
14 It does \fBnot\fR describe aliases files used by the message transport system.
|
|
15 Each line of the alias file has the format:
|
|
16
|
|
17 alias : address\-group
|
|
18 .br
|
|
19 or
|
|
20 .br
|
|
21 alias ; address\-group
|
|
22 .br
|
|
23 or
|
|
24 .br
|
|
25 < alias\-file
|
|
26 .br
|
|
27 or
|
|
28 .br
|
|
29 ; comment
|
|
30 .br
|
|
31
|
|
32 where:
|
|
33
|
|
34 address\-group := address\-list
|
|
35 .br
|
|
36 | \*(lq<\*(rq file
|
|
37 .br
|
|
38 | \*(lq=\*(rq UNIX\-group
|
|
39 .br
|
|
40 | \*(lq+\*(rq UNIX\-group
|
|
41 .br
|
|
42 | \*(lq*\*(rq
|
|
43
|
|
44 .br
|
|
45 address\-list := address
|
|
46 .br
|
|
47 | address\-list, address
|
|
48 .br
|
|
49
|
|
50 Continuation lines in alias files end with `\\' followed by the newline
|
|
51 character.
|
|
52
|
|
53 Alias\-file and file are UNIX file names.
|
|
54 UNIX\-group is a group name (or number) from \fI/etc/group\fR.
|
|
55 An address is a \*(lqsimple\*(rq Internet\-style address.
|
|
56 Througout this file, case is ignored, except for alias\-file names.
|
|
57
|
|
58 If the line starts with a `<', then the file named after the `<' is
|
|
59 read for more alias definitions. The reading is done recursively, so a `<'
|
|
60 may occur in the beginning of an alias file with the expected results.
|
|
61
|
|
62 If the address\-group starts with a `<',
|
|
63 then the file named after the `<' is read and its contents are added to
|
|
64 the address\-list for the alias.
|
|
65
|
|
66 If the address\-group starts with an `=',
|
|
67 then the file \fI/etc/group\fR is consulted
|
|
68 for the UNIX\-group named after the `='.
|
|
69 Each login name occurring as a member of the group is added to the
|
|
70 address\-list for the alias.
|
|
71
|
|
72 In contrast, if the address\-group starts with a `+',
|
|
73 then the file \fI/etc/group\fR is consulted
|
|
74 to determine the group\-id of the UNIX\-group named after the `+'.
|
|
75 Each login name occurring in the \fI/etc/passwd\fR file whose group\-id
|
|
76 is indicated by this group is added to the address\-list for the alias.
|
|
77
|
|
78 If the address\-group is simply `*',
|
|
79 then the file \fI/etc/passwd\fR is consulted
|
|
80 and all login names with a userid greater than some magic number
|
|
81 (usually 200) are added to the address\-list for the alias.
|
|
82
|
|
83 In match, a trailing * on an alias will match just about anything appropriate.
|
|
84 (See example below.)
|
|
85
|
|
86 An approximation of the way aliases are resolved at posting time is
|
|
87 (it's not really done this way):
|
|
88
|
|
89 .in +.5i
|
|
90 1) Build a list of all addresses from the message to be
|
|
91 delivered, eliminating duplicate addresses.
|
|
92
|
|
93 2) If this draft originated on the local host,
|
|
94 then for those addresses in the message that have no host specified,
|
|
95 perform alias resolution.
|
|
96
|
|
97 3) For each line in the alias file,
|
|
98 compare \*(lqalias\*(rq against all of the existing addresses.
|
|
99 If a match, remove the matched \*(lqalias\*(rq from the address list,
|
|
100 and add each new address in the address\-group to the address list
|
|
101 if it is not already on the list.
|
|
102 The alias itself is not usually output,
|
|
103 rather the address\-group that the alias maps to is output instead.
|
|
104 If \*(lqalias\*(rq is terminated with a `;' instead of a `:',
|
|
105 then both the \*(lqalias\*(rq and the address are output
|
|
106 in the correct format.
|
|
107 (This makes replies possible since \fIMH\fR aliases and
|
|
108 personal aliases are unknown to the mail transport system.)
|
|
109 .in -.5i
|
|
110
|
|
111 Since the alias file is read line by line, forward references
|
|
112 work, but backward references are not recognized, thus, there is
|
|
113 no recursion.
|
|
114
|
|
115 .ne 10
|
|
116 \fBExample:\fR
|
|
117 .nf
|
|
118 .in +.5i
|
|
119 </usr/local/mh/lib/BBoardAliases
|
|
120 sgroup: fred, fear, freida
|
|
121 b-people: Blind List: bill, betty;
|
|
122 fred: frated@UCI
|
|
123 UNIX\-committee: <unix.aliases
|
|
124 staff: =staff
|
|
125 wheels: +wheel
|
|
126 everyone: *
|
|
127 news.*: news
|
|
128 .in -.5i
|
|
129 .fi
|
|
130
|
|
131 The first line says that more aliases should immediately be read from
|
|
132 the file \fI/usr/local/mh/lib/BBoardAliases\fR.
|
|
133 Following this, \*(lqfred\*(rq is defined as an alias for
|
|
134 \*(lqfrated@UCI\*(rq,
|
|
135 and \*(lqsgroup\*(rq is defined as an alias for
|
|
136 the three names \*(lqfrated@UCI\*(rq, \*(rqfear\*(rq, and \*(rqfreida\*(rq.
|
|
137 .sp
|
|
138 The alias \*(lqb-people\*(rq is a blind list which includes the
|
|
139 addresses \*(lqbill\*(rq and \*(lqbetty\*(rq; the message
|
|
140 will be delieved to those addresses, but the
|
|
141 message header will show only \*(lqBlind List: ;\*(rq (not the addresses).
|
|
142 .sp
|
|
143 Next, the definition of \*(lqUNIX\-committee\*(rq is given by reading
|
|
144 the file \fIunix.aliases\fR in the users \fIMH\fR directory,
|
|
145 \*(lqstaff\*(rq is defined as all users who are listed as members of
|
|
146 the group \*(lqstaff\*(rq in the \fI/etc/group\fR file,
|
|
147 and \*(lqwheels\*(rq is defined as all users whose group\-id in
|
|
148 \fI/etc/passwd\fR is equivalent to the \*(lqwheel\*(rq group.
|
|
149 .sp
|
|
150 Finally, \*(lqeveryone\*(rq is defined as all users with a user\-id in
|
|
151 \fI/etc/passwd\fR greater than 200,
|
|
152 and all aliases of the form \*(lqnews.<anything>\*(rq are defined
|
|
153 to be \*(lqnews\*(rq.
|
|
154
|
|
155 The key thing to understand about aliasing in \fIMH\fR
|
|
156 is that aliases in \fIMH\fR alias files are expanded into the
|
|
157 headers of messages posted.
|
|
158 This aliasing occurs first,
|
|
159 at posting time,
|
|
160 without the knowledge of the message transport system.
|
|
161 In contrast,
|
|
162 once the message transport system is given a message to deliver
|
|
163 to a list of addresses,
|
|
164 for each address that appears to be local,
|
|
165 a system\-wide alias file is consulted.
|
|
166 These aliases are \fBNOT\fR expanded into the headers of messages delivered.
|
|
167 .Hh
|
|
168 To use aliasing in \fIMH\fR quickly, do the following:
|
|
169
|
|
170 .in +.5i
|
|
171 First, in your \fI\&.mh\(ruprofile\fR,
|
|
172 choose a name for your alias file, say \*(lqaliases\*(rq,
|
|
173 and add the line:
|
|
174
|
|
175 .nf
|
|
176 .in +.5i
|
|
177 Aliasfile: aliases
|
|
178 .\" ali: \-alias aliases
|
|
179 .\" send: \-alias aliases
|
|
180 .\" whom: \-alias ailases
|
|
181 .in -.5i
|
|
182 .fi
|
|
183
|
|
184 Second, create the file \*(lqaliases\*(rq in your \fIMH\fR directory.
|
|
185
|
|
186 Third, start adding aliases to your \*(lqaliases\*(rq file as appropriate.
|
|
187 .in -.5i
|
|
188 .Fi
|
|
189 ^/usr/local/mh/lib/MailAliases~^Primary alias file
|
|
190 .Pr
|
|
191 ^Aliasfile:~^For a default alias file
|
|
192 .Sa
|
|
193 ali(1), send(1), whom(1), group(5), passwd(5), conflict(8), post(8)
|
|
194 .De
|
|
195 None
|
|
196 .Co
|
|
197 None
|
|
198 .Hi
|
|
199 In previous releases of \fIMH\fR,
|
|
200 only a single, system\-wide mh\-alias file was supported.
|
|
201 This led to a number of problems,
|
|
202 since only mail\-system administrators were capable of (un)defining
|
|
203 aliases.
|
|
204 Hence,
|
|
205 the semantics of mh\-alias were extended to support personal alias files.
|
|
206 Users of \fIMH\fR no longer need to bother mail\-system administrators for
|
|
207 keeping information in the system\-wide alias file,
|
|
208 as each \fIMH\fR user can create/modify/remove aliases at will from any
|
|
209 number of personal files.
|
|
210 .Bu
|
|
211 Although the forward-referencing semantics of \fImh\-alias\fR files prevent
|
|
212 recursion, the \*(lq<\ alias\-file\*(rq command may defeat this. Since the
|
|
213 number of file descriptors is finite (and very limited), such infinite
|
|
214 recursion will terminate with a meaningless diagnostic when all the fds are
|
|
215 used up.
|
|
216 .sp
|
|
217 Forward references do not work correctly inside blind lists.
|
|
218 .En
|