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