File: mh-alias.man

package info (click to toggle)
nmh 1.6-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 6,204 kB
  • ctags: 3,851
  • sloc: ansic: 48,922; sh: 16,422; makefile: 559; perl: 509; lex: 402; awk: 74
file content (212 lines) | stat: -rw-r--r-- 5,675 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
.TH MH-ALIAS %manext5% "Oct 14, 2012" "%nmhversion%"
.\"
.\" %nmhwarning%
.\"
.SH NAME
mh-alias \- format of nmh alias files
.SH DESCRIPTION
.PP
Each line of an
.B nmh
alias file takes one of the following forms:
.PP
.RS 5
.I alias
.B :
.I address\-group
.RE
.sp
.RS 5
.I alias
.B ;
.I address\-group
.RE
.sp
.RS 5
.B <
.I alias\-file
.RE
.sp
.RS 5
.B ;
|
.B :
|
.B #
.I comment
.RE
.PP
where:
.PP
.RS 5
.nf
.IR address\-group "	:= " address\-list
.RI "			|  < " file
.RI "			|  = " UNIX\-group
.RI "			|  + " UNIX\-group
			|  *

.IR address\-list "	:= " address
.RI "			|  " address\-list ", " address
.fi
.RE
.PP
Continuation lines end with \*(lq\\\*(rq followed by a newline
character.  This also applies to comment lines.  Thus, the line following a
\*(lq\\\*(rq\-terminated
comment line is a continuation of
that comment line.
.PP
.I Alias\-file
and
.I file
are UNIX file names.
.I UNIX\-group
is a group name or number from
the system's group database.
Alias file contents are case-insensitive, with the exception
of filesystem path names.
.PP
If the line starts with a \*(lq<\*(rq, the file named after the \*(lq<\*(rq is
read for more alias definitions.  The reading is done recursively, so a
\*(lq<\*(rq may occur in the beginning of an alias file with the expected results.
.PP
If the
.I address\-group
starts with a \*(lq<\*(rq, the file named after the
\*(lq<\*(rq is read and its contents are added to the
.I address\-list
for the alias.
.PP
If the
.I address\-group
starts with an \*(lq=\*(rq, the
system's group database
is consulted for the UNIX\-group named after the \*(lq=\*(rq.  Each login name
occurring as a member of the group is added to the
.I address\-list
for the alias.
.PP
In contrast, if the
.I address\-group
starts with a \*(lq+\*(rq, the system's group database
is consulted to determine the group\-id of the
UNIX\-group named after the \*(lq+\*(rq.  Each login name occurring in the
system's password database
whose group\-id is indicated by this group is
added to the
.I address\-list
for the alias.
.PP
If the
.I address\-group
is simply \*(lq*\*(rq, the system's password database
is consulted and all login names with a userid
greater than some magic number (usually 200) are added to the
.I address\-list
for the alias.
.B
This feature is obsolescent and will be removed in a future release.
.PP
In match, a trailing \*(lq*\*(rq on an alias will match just about anything
appropriate.
.PP
An approximation of the way aliases are resolved at posting time is:
.IP 1)
Build a list of all addresses from the message to be delivered,
eliminating duplicate addresses.
.IP 2)
If this draft originated on the local host, then for those addresses in
the message that have no host specified, perform alias resolution.
.IP 3)
For each line in the alias file, compare \*(lqalias\*(rq against all of
the existing addresses.  If a match, remove the matched \*(lqalias\*(rq
from the address list, and add each new address in the address\-group to
the address list if it is not already on the list.  The alias itself is
not usually output, rather the address\-group that the alias maps to is
output instead.  If \*(lqalias\*(rq is terminated with a \*(lq;\*(rq instead of
a \*(lq:\*(rq, then both the \*(lqalias\*(rq and the address are output in the
correct format (with the alias quoted if necessary and the address
wrapped in <>).
.PP
Since the
.I mh-alias
file is read line by line, forward references work, but
backward references are not recognized.
.SS
Example Alias File
.PP
.RS 5
.nf
<%etcdir%/BBoardAliases
fred: frated@UCI.example
sgroup: fred, fear, freida
b-people: Blind List: bill, betty
UNIX\-committee: <unix.aliases
staff: =staff
wheels: +wheel
news.*: news
.fi
.RE
.PP
The first line says that more aliases should immediately be read from
the file
.BR %etcdir%/BBoardAliases .
Following this, \*(lqfred\*(rq
is defined as an alias for \*(lqfrated@UCI.example\*(rq, and \*(lqsgroup\*(rq
is defined as an alias for the three names \*(lqfrated@UCI.example\*(rq,
\*(rqfear\*(rq, and \*(rqfreida\*(rq.
.PP
The alias \*(lqb-people\*(rq is a blind list which includes the addresses
\*(lqbill\*(rq and \*(lqbetty\*(rq; the message will be delivered to those
addresses, but the message header will show only \*(lqBlind List: ;\*(rq
(not the addresses).  The alias must not be terminated with, or contain,
a semicolon.
Note that blind lists are not supported with the
.B sendmail/pipe
mail transport method.
.PP
Next, the definition of \*(lqUNIX\-committee\*(rq is given by
reading the file
.I unix.aliases
in the user's
.B nmh
directory,
\*(lqstaff\*(rq is defined as all users who are listed as members of the
group \*(lqstaff\*(rq in the
system's group database, and \*(lqwheels\*(rq
is defined as all users whose group\-id in
the system's password database
is equivalent to the \*(lqwheel\*(rq group.
.SH "PROFILE COMPONENTS"
.TP 20
Aliasfile:
Default alias file.
.SH FILES
.TP 20
%etcdir%/MailAliases
System-wide default alias file.
.SH "SEE ALSO"
.IR ali (1),
.IR send (1),
.IR whom (1),
.IR getgrent (3),
.IR getpwent (3),
.IR conflict (8),
.IR post (8)
.SH BUGS
Although the forward-referencing semantics of
mh\-alias
files prevent recursion, the
.B alias\-file
directive may defeat this.
Since the number of file descriptors is finite, such
infinite recursion will terminate with a meaningless diagnostic when
all the fds are used up.
.PP
Earlier versions of this man page showed a semicolon at the end of the
blind list example.  That caused the preceding alias to not be
expanded.  There must not be a semicolon at the end of, or within, the
address group of a blind list.
.B post
will append the semicolon to the blind list name.