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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
|
'\" te
.\" Copyright (c) 2003 Sun Microsystems, Inc. - All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH ALIASES 4 "Feb 25, 2017"
.SH NAME
aliases, addresses, forward \- addresses and aliases for sendmail
.SH SYNOPSIS
.LP
.nf
/etc/mail/aliases
.fi
.LP
.nf
/etc/mail/aliases.db
.fi
.LP
.nf
/etc/mail/aliases.dir
.fi
.LP
.nf
/etc/mail/aliases.pag
.fi
.LP
.nf
~/.forward
.fi
.SH DESCRIPTION
.LP
These files contain mail addresses or aliases, recognized by \fBsendmail\fR(1M)
for the local host:
.sp
.ne 2
.na
\fB/etc/passwd\fR
.ad
.sp .6
.RS 4n
Mail addresses (usernames) of local users.
.RE
.sp
.ne 2
.na
\fB/etc/mail/aliases\fR
.ad
.sp .6
.RS 4n
Aliases for the local host, in \fBASCII\fR format. Root can edit this file to
add, update, or delete local mail aliases.
.RE
.sp
.ne 2
.na
\fB\fB/etc/mail/aliases.\fR{\fIdir\fR , \fIpag\fR}\fR
.ad
.sp .6
.RS 4n
The aliasing information from \fB/etc/mail/aliases\fR, in binary \fBndbm\fR(3C)
format for use by \fBsendmail\fR(1M). The program \fBnewaliases\fR(1M)
maintains these files.
.RE
.sp
.ne 2
.na
\fB/etc/mail/aliases.db\fR
.ad
.sp .6
.RS 4n
The aliasing information from \fB/etc/mail/aliases\fR, in binary, Berkeley
DataBase format for use by \fBsendmail\fR(1M). The program maintains these
files.
.sp
Depending on the configuration of the AliasFile option in
\fB/etc/mail/sendmail.cf\fR, either the single file \fBaliases.db\fR or the
pair of files \fBaliases.\fR{dir, pag} is generated by \fBnewaliases\fR(1M). As
shipped with Solaris, \fBsendmail\fR(1M) supports both formats. If neither is
specified, the Berkeley DataBase format which generates the single \fB\&.db\fR
file is used.
.RE
.sp
.ne 2
.na
\fB~/.forward\fR
.ad
.sp .6
.RS 4n
Addresses to which a user's mail is forwarded (see \fBAutomatic Forwarding\fR).
.RE
.sp
.LP
In addition, the \fBNIS\fR name services aliases map \fImail.aliases\fR
contains addresses and aliases
available for use across the network.
.SS "Addresses"
.LP
As distributed, \fBsendmail\fR(1M) supports the following types of addresses:
.SS "Local Usernames"
.in +2
.nf
\fIusername\fR
.fi
.in -2
.sp
.LP
Each local \fIusername\fR is listed in the local host's \fB/etc/passwd\fR file.
.SS "Local Filenames"
.in +2
.nf
\fIpathname\fR
.fi
.in -2
.sp
.LP
Messages addressed to the absolute \fIpathname\fR of a file are appended to
that file.
.SS "Commands"
.in +2
.nf
\fB|\fR\fBcommand\fR
.fi
.in -2
.sp
.LP
If the first character of the address is a vertical bar (\fB\||\|\fR),
\fBsendmail\fR(1M) pipes the message to the standard input of the \fBcommand\fR
the bar precedes.
.SS "Internet-standard Addresses"
.in +2
.nf
\fIusername\fR\fB@\fR\fIdomain\fR
.fi
.in -2
.sp
.LP
If \fIdomain\fR does not contain any `\fB\&.\fR' (dots), then it is interpreted
as the name of a host in the current domain. Otherwise, the message is passed
to a \fImailhost\fR that determines how to get to the specified domain. Domains
are divided into subdomains separated by dots, with the top-level domain on the
right.
.sp
.LP
For example, the full address of John Smith could be:
.sp
.in +2
.nf
\fBjs@jsmachine.Podunk-U.EDU\fR
.fi
.in -2
.sp
.LP
if he uses the machine named \fBjsmachine\fR at Podunk University.
.SS "\fBuucp\fR Addresses"
.in +2
.nf
\&.\|.\|. [\fIhost\fR\fB!\fR] \fIhost\fR\fB!\fR\fIusername\fR
.fi
.in -2
.sp
.LP
These are sometimes mistakenly referred to as ``Usenet'' addresses.
\fBuucp\fR(1C) provides links to numerous sites throughout the world for the
remote copying of files.
.sp
.LP
Other site-specific forms of addressing can be added by customizing the
\fBsendmail.cf\fR configuration file. See \fBsendmail\fR(1M) for details.
Standard addresses are recommended.
.SS "Aliases"
.SS "Local Aliases"
.LP
\fB/etc/mail/aliases\fR is formatted as a series of lines of the form
.sp
.in +2
.nf
\fIaliasname\fR\fB:\fR\fIaddress\fR[, \fIaddress\fR]
.fi
.in -2
.sp
.LP
\fIaliasname\fR is the name of the alias or alias group, and \fIaddress\fR is
the address of a recipient in the group. Aliases can be nested. That is, an
\fIaddress\fR can be the name of another alias group. Because of the way
\fBsendmail\fR(1M) performs mapping from upper-case to lower-case, an
\fIaddress\fR that is the name of another alias group must not contain any
upper-case letters.
.sp
.LP
Lines beginning with white space are treated as continuation lines for the
preceding alias. Lines beginning with \fB#\fR are comments.
.SS "Special Aliases"
.LP
An alias of the form:
.sp
.in +2
.nf
\fBowner-aliasname :\fR \fIaddress\fR
.fi
.in -2
.sp
.LP
\fBsendmail\fR directs error-messages resulting from mail to \fIaliasname\fR to
\fIaddress\fR, instead of back to the person who sent the message.
\fBsendmail\fR rewrites the \fBSMTP\fR envelope sender to match this, so
\fBowner-aliasname\fR should always point to \fBalias-request\fR, and
\fBalias-request\fR should point to the owner's actual address:
.sp
.in +2
.nf
owner-aliasname: aliasname-request
aliasname-request \fIaddress\fR
.fi
.in -2
.sp
.LP
An alias of the form:
.sp
.in +2
.nf
\fIaliasname\fR\fB: :include:\fR\fIpathname\fR
.fi
.in -2
.sp
.LP
with colons as shown, adds the recipients listed in the file \fIpathname\fR to
the \fIaliasname\fR alias. This allows a private list to be maintained
separately from the aliases file.
.SS "NIS Domain Aliases"
.LP
The aliases file on the master \fBNIS\fR server is used for the
\fImail.aliases\fR \fBNIS\fR map, which can be made available to every
\fBNIS\fR client. Thus, the \fB/etc/mail/aliases*\fR files on the various
hosts in a network will one day be obsolete. Domain-wide aliases should
ultimately be resolved into usernames on specific hosts. For example, if the
following were in the domain-wide alias file:
.sp
.in +2
.nf
jsmith:js@jsmachine
.fi
.in -2
.sp
.LP
then any \fBNIS\fR client could just mail to \fBjsmith\fR and not
have to remember the machine and username for John Smith.
.sp
.LP
If a \fBNIS\fR alias does not resolve to an address with a
specific host, then the name of the \fBNIS\fR domain is used.
There should be an alias of the domain name for a host in this case.
.sp
.LP
For example, the alias:
.sp
.in +2
.nf
jsmith:root
.fi
.in -2
.sp
.LP
sends mail on a \fBNIS\fR client to \fBroot@podunk-u\fR if the
name of the \fBNIS\fR domain is \fBpodunk-u\fR.
.SS "Automatic Forwarding"
.LP
When an alias (or address) is resolved to the name of a user on the local host,
\fBsendmail\fR(1M) checks for a ~/.forward file, owned by the intended
recipient, in that user's home directory, and with universal read access. This
file can contain one or more addresses or aliases as described above, each of
which is sent a copy of the user's mail.
.sp
.LP
Care must be taken to avoid creating addressing loops in the \fB~/.forward\fR
file. When forwarding mail between machines, be sure that the destination
machine does not return the mail to the sender through the operation of any
\fBNIS\fR aliases. Otherwise, copies of the message may "bounce." Usually, the
solution is to change the \fBNIS\fR alias to direct mail to the proper
destination.
.sp
.LP
A backslash before a username inhibits further aliasing. For instance, to
invoke the \fBvacation\fR program, user \fBjs\fR creates a \fB~/.forward\fR
file that contains the line:
.sp
.in +2
.nf
\ejs, "|/usr/ucb/vacation js"
.fi
.in -2
.sp
.LP
so that one copy of the message is sent to the user, and another is piped into
the \fBvacation\fR program.
.sp
.LP
The \fB~/.forward\fR file can be used to specify special "per user" extensions
by creating a \fB\&.forward+extension\fR file in the home directory. For
example, with an address like \fBjsmith+jerry@jsmachine\fR, the
\fBsendmail\fR(1M) utility recognizes everything before the "\fB+\fR" as the
actual username (\fBjsmith\fR) and everything after it, up to the "\fB@\fR"
symbol, as the extension (\fBjerry\fR) which is passed to the mail delivery
agent for local use.
.sp
.LP
The default value of the \fBForwardPath\fR processing option in
\fBsendmail\fR(1M) is:
.sp
.in +2
.nf
O ForwardPath=$z/.forward.$w+$h:$z/.forward+$h:$z/.forward.$w:$z \e
/.forward
.fi
.in -2
.sp
.LP
where \fB$z\fR is the macro for the user's home directory, \fB$w\fR is the
macro for the local machine name and \fB$h\fR is the extension. For example,
for mail using the address, \fBjsmith+jerry@jsmachine\fR, the
\fBsendmail\fR(1M) utility checks each of the four following file names, in the
order given, to see if it exists and if it has "safe" permissions, that is,
that neither the file nor any of its parent directories are group- or
world-writable:
.sp
.in +2
.nf
~jsmith/.forward.jsmachine+jerry
~jsmith/.forward+jerry
~jsmith/.forward.jsmachine
~jsmith/.forward
.fi
.in -2
.sp
.LP
The first file that meets the conditions is used to forward the mail, that is,
all the entries in that file receive a copy of the mail. The search is then
stopped.
.SH FILES
.ne 2
.na
\fB\fB/etc/passwd\fR\fR
.ad
.RS 25n
Password file
.RE
.sp
.ne 2
.na
\fB\fB/etc/nsswitch.conf\fR\fR
.ad
.RS 25n
Name service switch configuration file
.RE
.sp
.ne 2
.na
\fB\fB/etc/mail/aliases\fR\fR
.ad
.RS 25n
Mail aliases file (ascii)
.RE
.sp
.ne 2
.na
\fB\fB/etc/mail/aliases.db\fR\fR
.ad
.RS 25n
Database of mail aliases (binary)
.RE
.sp
.ne 2
.na
\fB\fB/etc/mail/aliases.dir\fR\fR
.ad
.RS 25n
Database of mail aliases (binary)
.RE
.sp
.ne 2
.na
\fB\fB/etc/mail/aliases.pag\fR\fR
.ad
.RS 25n
Database of mail aliases (binary)
.RE
.sp
.ne 2
.na
\fB\fB/etc/mail/sendmail.cf\fR\fR
.ad
.RS 25n
sendmail configuration file
.RE
.sp
.ne 2
.na
\fB\fB~/.forward\fR\fR
.ad
.RS 25n
Forwarding information file
.RE
.SH SEE ALSO
.LP
\fBpasswd\fR(1), \fBuucp\fR(1C), \fBvacation\fR(1), \fBnewaliases\fR(1M),
\fBsendmail\fR(1M), \fBndbm\fR(3C), \fBgetusershell\fR(3C), \fBpasswd\fR(4),
\fBshells\fR(4), \fBattributes\fR(5)
.SH NOTES
.LP
Because of restrictions in \fBndbm\fR(3C), a single alias cannot contain more
than about \fB1000\fR characters (if this format is used). The Berkeley
DataBase format does not have any such restriction. Nested aliases can be used
to circumvent this limit.
.sp
.LP
For aliases which result in piping to a program or concatenating a file, the
shell of the controlling user must be allowed. Which shells are and are not
allowed are determined by \fBgetusershell\fR(3C).
|