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