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