]> diplodocus.org Git - nmh/blob - man/mh-alias.man
Added note that suffixes were removed from filenames of temporary files.
[nmh] / man / mh-alias.man
1 .TH MH-ALIAS %manext5% "Oct 14, 2012" "%nmhversion%"
2 .\"
3 .\" %nmhwarning%
4 .\"
5 .SH NAME
6 mh-alias \- format of nmh alias files
7 .SH DESCRIPTION
8 .PP
9 Each line of an
10 .B nmh
11 alias file takes one of the following forms:
12 .PP
13 .RS 5
14 .I alias
15 .B :
16 .I address\-group
17 .RE
18 .sp
19 .RS 5
20 .I alias
21 .B ;
22 .I address\-group
23 .RE
24 .sp
25 .RS 5
26 .B <
27 .I alias\-file
28 .RE
29 .sp
30 .RS 5
31 .B ;
32 |
33 .B :
34 |
35 .B #
36 .I comment
37 .RE
38 .PP
39 where:
40 .PP
41 .RS 5
42 .nf
43 .IR address\-group " := " address\-list
44 .RI " | < " file
45 .RI " | = " UNIX\-group
46 .RI " | + " UNIX\-group
47 | *
48
49 .IR address\-list " := " address
50 .RI " | " address\-list ", " address
51 .fi
52 .RE
53 .PP
54 Continuation lines end with \*(lq\\\*(rq followed by a newline
55 character. This also applies to comment lines. Thus, the line following a
56 \*(lq\\\*(rq\-terminated
57 comment line is a continuation of
58 that comment line.
59 .PP
60 .I Alias\-file
61 and
62 .I file
63 are UNIX file names.
64 .I UNIX\-group
65 is a group name or number from
66 the system's group database.
67 Alias file contents are case-insensitive, with the exception
68 of filesystem path names.
69 .PP
70 If the line starts with a \*(lq<\*(rq, the file named after the \*(lq<\*(rq is
71 read for more alias definitions. The reading is done recursively, so a
72 \*(lq<\*(rq may occur in the beginning of an alias file with the expected results.
73 .PP
74 If the
75 .I address\-group
76 starts with a \*(lq<\*(rq, the file named after the
77 \*(lq<\*(rq is read and its contents are added to the
78 .I address\-list
79 for the alias.
80 .PP
81 If the
82 .I address\-group
83 starts with an \*(lq=\*(rq, the
84 system's group database
85 is consulted for the UNIX\-group named after the \*(lq=\*(rq. Each login name
86 occurring as a member of the group is added to the
87 .I address\-list
88 for the alias.
89 .PP
90 In contrast, if the
91 .I address\-group
92 starts with a \*(lq+\*(rq, the system's group database
93 is consulted to determine the group\-id of the
94 UNIX\-group named after the \*(lq+\*(rq. Each login name occurring in the
95 system's password database
96 whose group\-id is indicated by this group is
97 added to the
98 .I address\-list
99 for the alias.
100 .PP
101 If the
102 .I address\-group
103 is simply \*(lq*\*(rq, the system's password database
104 is consulted and all login names with a userid
105 greater than some magic number (usually 200) are added to the
106 .I address\-list
107 for the alias.
108 .B
109 This feature is obsolescent and will be removed in a future release.
110 .PP
111 In match, a trailing \*(lq*\*(rq on an alias will match just about anything
112 appropriate.
113 .PP
114 An approximation of the way aliases are resolved at posting time is:
115 .IP 1)
116 Build a list of all addresses from the message to be delivered,
117 eliminating duplicate addresses.
118 .IP 2)
119 If this draft originated on the local host, then for those addresses in
120 the message that have no host specified, perform alias resolution.
121 .IP 3)
122 For each line in the alias file, compare \*(lqalias\*(rq against all of
123 the existing addresses. If a match, remove the matched \*(lqalias\*(rq
124 from the address list, and add each new address in the address\-group to
125 the address list if it is not already on the list. The alias itself is
126 not usually output, rather the address\-group that the alias maps to is
127 output instead. If \*(lqalias\*(rq is terminated with a \*(lq;\*(rq instead of
128 a \*(lq:\*(rq, then both the \*(lqalias\*(rq and the address are output in the
129 correct format (with the alias quoted if necessary and the address
130 wrapped in <>).
131 .PP
132 Since the
133 .I mh-alias
134 file is read line by line, forward references work, but
135 backward references are not recognized.
136 .SS
137 Example Alias File
138 .PP
139 .RS 5
140 .nf
141 <%etcdir%/BBoardAliases
142 fred: frated@UCI.example
143 sgroup: fred, fear, freida
144 b-people: Blind List: bill, betty
145 UNIX\-committee: <unix.aliases
146 staff: =staff
147 wheels: +wheel
148 news.*: news
149 .fi
150 .RE
151 .PP
152 The first line says that more aliases should immediately be read from
153 the file
154 .BR %etcdir%/BBoardAliases .
155 Following this, \*(lqfred\*(rq
156 is defined as an alias for \*(lqfrated@UCI.example\*(rq, and \*(lqsgroup\*(rq
157 is defined as an alias for the three names \*(lqfrated@UCI.example\*(rq,
158 \*(rqfear\*(rq, and \*(rqfreida\*(rq.
159 .PP
160 The alias \*(lqb-people\*(rq is a blind list which includes the addresses
161 \*(lqbill\*(rq and \*(lqbetty\*(rq; the message will be delivered to those
162 addresses, but the message header will show only \*(lqBlind List: ;\*(rq
163 (not the addresses). The alias must not be terminated with, or contain,
164 a semicolon.
165 Note that blind lists are not supported with the
166 .B sendmail/pipe
167 mail transport method.
168 .PP
169 Next, the definition of \*(lqUNIX\-committee\*(rq is given by
170 reading the file
171 .I unix.aliases
172 in the user's
173 .B nmh
174 directory,
175 \*(lqstaff\*(rq is defined as all users who are listed as members of the
176 group \*(lqstaff\*(rq in the
177 system's group database, and \*(lqwheels\*(rq
178 is defined as all users whose group\-id in
179 the system's password database
180 is equivalent to the \*(lqwheel\*(rq group.
181 .SH "PROFILE COMPONENTS"
182 .TP 20
183 Aliasfile:
184 Default alias file.
185 .SH FILES
186 .TP 20
187 %etcdir%/MailAliases
188 System-wide default alias file.
189 .SH "SEE ALSO"
190 .IR ali (1),
191 .IR send (1),
192 .IR whom (1),
193 .IR getgrent (3),
194 .IR getpwent (3),
195 .IR conflict (8),
196 .IR post (8)
197 .SH BUGS
198 Although the forward-referencing semantics of
199 mh\-alias
200 files prevent recursion, the
201 .B alias\-file
202 directive may defeat this.
203 Since the number of file descriptors is finite, such
204 infinite recursion will terminate with a meaningless diagnostic when
205 all the fds are used up.
206 .PP
207 Earlier versions of this man page showed a semicolon at the end of the
208 blind list example. That caused the preceding alias to not be
209 expanded. There must not be a semicolon at the end of, or within, the
210 address group of a blind list.
211 .B post
212 will append the semicolon to the blind list name.