components/sendmail/files/man/sendmail-aliases.5
changeset 5566 9009ada25177
parent 3649 4006eaaa7d29
child 7820 a2b9a7de9e1a
equal deleted inserted replaced
5565:f678cc44b3d0 5566:9009ada25177
       
     1 '\" te
       
     2 .\" Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
       
     3 .TH aliases 5 "8 Mar 2016" "SunOS 5.12" "File Formats"
       
     4 .SH NAME
       
     5 aliases, addresses, forward \- addresses and aliases for sendmail
       
     6 .SH SYNOPSIS
       
     7 .LP
       
     8 .nf
       
     9 /etc/mail/aliases
       
    10 .fi
       
    11 
       
    12 .LP
       
    13 .nf
       
    14 /etc/mail/aliases.db
       
    15 .fi
       
    16 
       
    17 .LP
       
    18 .nf
       
    19 /etc/mail/aliases.dir
       
    20 .fi
       
    21 
       
    22 .LP
       
    23 .nf
       
    24 /etc/mail/aliases.pag
       
    25 .fi
       
    26 
       
    27 .LP
       
    28 .nf
       
    29 ~/.forward
       
    30 .fi
       
    31 
       
    32 .SH DESCRIPTION
       
    33 .sp
       
    34 .LP
       
    35 These files contain mail addresses or aliases, recognized by \fBsendmail\fR(8) for the local host:
       
    36 .sp
       
    37 .ne 2
       
    38 .mk
       
    39 .na
       
    40 \fB/etc/passwd\fR
       
    41 .ad
       
    42 .sp .6
       
    43 .RS 4n
       
    44 Mail addresses (usernames) of local users.
       
    45 .RE
       
    46 
       
    47 .sp
       
    48 .ne 2
       
    49 .mk
       
    50 .na
       
    51 \fB/etc/mail/aliases\fR
       
    52 .ad
       
    53 .sp .6
       
    54 .RS 4n
       
    55 Aliases for the local host, in \fBASCII\fR format. Root can edit this file to add, update, or delete local mail aliases. 
       
    56 .RE
       
    57 
       
    58 .sp
       
    59 .ne 2
       
    60 .mk
       
    61 .na
       
    62 \fB\fB/etc/mail/aliases.\fR{\fIdir\fR , \fIpag\fR}\fR
       
    63 .ad
       
    64 .sp .6
       
    65 .RS 4n
       
    66 The aliasing information from \fB/etc/mail/aliases\fR, in binary \fBndbm\fR(3C) format for use by \fBsendmail\fR(8). The program \fBnewaliases\fR(8) maintains these files.
       
    67 .RE
       
    68 
       
    69 .sp
       
    70 .ne 2
       
    71 .mk
       
    72 .na
       
    73 \fB/etc/mail/aliases.db\fR
       
    74 .ad
       
    75 .sp .6
       
    76 .RS 4n
       
    77 The aliasing information from \fB/etc/mail/aliases\fR, in binary, Berkeley DataBase format for use by \fBsendmail\fR(8). The program maintains these files. 
       
    78 .sp
       
    79 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(8). As shipped with Solaris, \fBsendmail\fR(8) supports both formats. If neither is specified, the Berkeley DataBase format which generates the single \fB\&.db\fR file is used.
       
    80 .RE
       
    81 
       
    82 .sp
       
    83 .ne 2
       
    84 .mk
       
    85 .na
       
    86 \fB~/.forward\fR
       
    87 .ad
       
    88 .sp .6
       
    89 .RS 4n
       
    90 Addresses to which a user's mail is forwarded (see \fBAutomatic Forwarding\fR).
       
    91 .RE
       
    92 
       
    93 .sp
       
    94 .LP
       
    95 In addition, the \fBNIS\fR name services aliases map \fImail.aliases\fR contains addresses and aliases available for use across the network.
       
    96 .SS "Addresses"
       
    97 .sp
       
    98 .LP
       
    99 As distributed, \fBsendmail\fR(8) supports the following types of addresses:
       
   100 .SS "Local Usernames"
       
   101 .sp
       
   102 .in +2
       
   103 .nf
       
   104 \fIusername\fR
       
   105 .fi
       
   106 .in -2
       
   107 
       
   108 .sp
       
   109 .LP
       
   110 Each local \fIusername\fR is listed in the local host's \fB/etc/passwd\fR file.
       
   111 .SS "Local Filenames"
       
   112 .sp
       
   113 .in +2
       
   114 .nf
       
   115 \fIpathname\fR
       
   116 .fi
       
   117 .in -2
       
   118 
       
   119 .sp
       
   120 .LP
       
   121 Messages addressed to the absolute \fIpathname\fR of a file are appended to that file.
       
   122 .SS "Commands"
       
   123 .sp
       
   124 .in +2
       
   125 .nf
       
   126 \fB|\fR\fBcommand\fR
       
   127 .fi
       
   128 .in -2
       
   129 
       
   130 .sp
       
   131 .LP
       
   132 If the first character of the address is a vertical bar (\fB\||\|\fR), \fBsendmail\fR(8) pipes the message to the standard input of the \fBcommand\fR the bar precedes.
       
   133 .SS "Internet-standard Addresses"
       
   134 .sp
       
   135 .in +2
       
   136 .nf
       
   137 \fIusername\fR\fB@\fR\fIdomain\fR
       
   138 .fi
       
   139 .in -2
       
   140 
       
   141 .sp
       
   142 .LP
       
   143 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. 
       
   144 .sp
       
   145 .LP
       
   146 For example, the full address of John Smith could be:
       
   147 .sp
       
   148 .in +2
       
   149 .nf
       
   150 \[email protected]\fR
       
   151 .fi
       
   152 .in -2
       
   153 
       
   154 .sp
       
   155 .LP
       
   156 if he uses the machine named \fBjsmachine\fR at Podunk University.
       
   157 .SS "\fBuucp\fR Addresses"
       
   158 .sp
       
   159 .in +2
       
   160 .nf
       
   161 \&.\|.\|. [\fIhost\fR\fB!\fR] \fIhost\fR\fB!\fR\fIusername\fR
       
   162 .fi
       
   163 .in -2
       
   164 
       
   165 .sp
       
   166 .LP
       
   167 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.
       
   168 .sp
       
   169 .LP
       
   170 Other site-specific forms of addressing can be added by customizing the \fBsendmail.cf\fR configuration file. See \fBsendmail\fR(8) for details. Standard addresses are recommended.
       
   171 .SS "Aliases"
       
   172 .SS "Local Aliases"
       
   173 .sp
       
   174 .LP
       
   175 \fB/etc/mail/aliases\fR is formatted as a series of lines of the form
       
   176 .sp
       
   177 .in +2
       
   178 .nf
       
   179 \fIaliasname\fR\fB:\fR\fIaddress\fR[, \fIaddress\fR]
       
   180 .fi
       
   181 .in -2
       
   182 
       
   183 .sp
       
   184 .LP
       
   185 \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(8) 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.
       
   186 .sp
       
   187 .LP
       
   188 Lines beginning with white space are treated as continuation lines for the preceding alias. Lines beginning with \fB#\fR are comments.
       
   189 .SS "Special Aliases"
       
   190 .sp
       
   191 .LP
       
   192 An alias of the form:
       
   193 .sp
       
   194 .in +2
       
   195 .nf
       
   196 \fBowner-aliasname :\fR \fIaddress\fR
       
   197 .fi
       
   198 .in -2
       
   199 
       
   200 .sp
       
   201 .LP
       
   202 \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:
       
   203 .sp
       
   204 .in +2
       
   205 .nf
       
   206 owner-aliasname:      aliasname-request
       
   207 aliasname-request     \fIaddress\fR
       
   208 .fi
       
   209 .in -2
       
   210 
       
   211 .sp
       
   212 .LP
       
   213 An alias of the form:
       
   214 .sp
       
   215 .in +2
       
   216 .nf
       
   217 \fIaliasname\fR\fB: :include:\fR\fIpathname\fR
       
   218 .fi
       
   219 .in -2
       
   220 
       
   221 .sp
       
   222 .LP
       
   223 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.
       
   224 .SS "NIS Domain Aliases"
       
   225 .sp
       
   226 .LP
       
   227 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:
       
   228 .sp
       
   229 .in +2
       
   230 .nf
       
   231 jsmith:js@jsmachine
       
   232 .fi
       
   233 .in -2
       
   234 
       
   235 .sp
       
   236 .LP
       
   237 then any \fBNIS\fR client could just mail to \fBjsmith\fR and not have to remember the machine and username for John Smith.
       
   238 .sp
       
   239 .LP
       
   240 If an \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.
       
   241 .sp
       
   242 .LP
       
   243 For example, the alias:
       
   244 .sp
       
   245 .in +2
       
   246 .nf
       
   247 jsmith:root
       
   248 .fi
       
   249 .in -2
       
   250 
       
   251 .sp
       
   252 .LP
       
   253 sends mail on an \fBNIS\fR client to \fBroot@podunk-u\fR if the name of the \fBNIS\fR domain is \fBpodunk-u\fR.
       
   254 .SS "Automatic Forwarding"
       
   255 .sp
       
   256 .LP
       
   257 When an alias (or address) is resolved to the name of a user on the local host, \fBsendmail\fR(8) 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.
       
   258 .sp
       
   259 .LP
       
   260 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.
       
   261 .sp
       
   262 .LP
       
   263 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:
       
   264 .sp
       
   265 .in +2
       
   266 .nf
       
   267 \ejs, "|/usr/bin/vacation js"
       
   268 .fi
       
   269 .in -2
       
   270 
       
   271 .sp
       
   272 .LP
       
   273 so that one copy of the message is sent to the user, and another is piped into the \fBvacation\fR program.
       
   274 .sp
       
   275 .LP
       
   276 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(8) 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.
       
   277 .sp
       
   278 .LP
       
   279 The default value of the \fBForwardPath\fR processing option in \fBsendmail\fR(8) is:
       
   280 .sp
       
   281 .in +2
       
   282 .nf
       
   283 O ForwardPath=$z/.forward.$w+$h:$z/.forward+$h:$z/.forward.$w:$z \e
       
   284 /.forward
       
   285 .fi
       
   286 .in -2
       
   287 
       
   288 .sp
       
   289 .LP
       
   290 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(8) 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: 
       
   291 .sp
       
   292 .in +2
       
   293 .nf
       
   294 ~jsmith/.forward.jsmachine+jerry
       
   295 ~jsmith/.forward+jerry
       
   296 ~jsmith/.forward.jsmachine
       
   297 ~jsmith/.forward
       
   298 .fi
       
   299 .in -2
       
   300 
       
   301 .sp
       
   302 .LP
       
   303 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.
       
   304 .SH FILES
       
   305 .sp
       
   306 .ne 2
       
   307 .mk
       
   308 .na
       
   309 \fB\fB/etc/passwd\fR\fR
       
   310 .ad
       
   311 .RS 25n
       
   312 .rt  
       
   313 Password file
       
   314 .RE
       
   315 
       
   316 .sp
       
   317 .ne 2
       
   318 .mk
       
   319 .na
       
   320 \fB\fB/etc/nsswitch.conf\fR\fR
       
   321 .ad
       
   322 .RS 25n
       
   323 .rt  
       
   324 Name service switch configuration file
       
   325 .RE
       
   326 
       
   327 .sp
       
   328 .ne 2
       
   329 .mk
       
   330 .na
       
   331 \fB\fB/etc/mail/aliases\fR\fR
       
   332 .ad
       
   333 .RS 25n
       
   334 .rt  
       
   335 Mail aliases file (ascii)
       
   336 .RE
       
   337 
       
   338 .sp
       
   339 .ne 2
       
   340 .mk
       
   341 .na
       
   342 \fB\fB/etc/mail/aliases.db\fR\fR
       
   343 .ad
       
   344 .RS 25n
       
   345 .rt  
       
   346 Database of mail aliases (binary)
       
   347 .RE
       
   348 
       
   349 .sp
       
   350 .ne 2
       
   351 .mk
       
   352 .na
       
   353 \fB\fB/etc/mail/aliases.dir\fR\fR
       
   354 .ad
       
   355 .RS 25n
       
   356 .rt  
       
   357 Database of mail aliases (binary)
       
   358 .RE
       
   359 
       
   360 .sp
       
   361 .ne 2
       
   362 .mk
       
   363 .na
       
   364 \fB\fB/etc/mail/aliases.pag\fR\fR
       
   365 .ad
       
   366 .RS 25n
       
   367 .rt  
       
   368 Database of mail aliases (binary)
       
   369 .RE
       
   370 
       
   371 .sp
       
   372 .ne 2
       
   373 .mk
       
   374 .na
       
   375 \fB\fB/etc/mail/sendmail.cf\fR\fR
       
   376 .ad
       
   377 .RS 25n
       
   378 .rt  
       
   379 sendmail configuration file
       
   380 .RE
       
   381 
       
   382 .sp
       
   383 .ne 2
       
   384 .mk
       
   385 .na
       
   386 \fB\fB~/.forward\fR\fR
       
   387 .ad
       
   388 .RS 25n
       
   389 .rt  
       
   390 Forwarding information file
       
   391 .RE
       
   392 
       
   393 .SH ATTRIBUTES
       
   394 .sp
       
   395 .LP
       
   396 See \fBattributes\fR(7) for descriptions of the following attributes:
       
   397 .sp
       
   398 
       
   399 .sp
       
   400 .TS
       
   401 tab() box;
       
   402 cw(2.75i) |cw(2.75i) 
       
   403 lw(2.75i) |lw(2.75i) 
       
   404 .
       
   405 ATTRIBUTE TYPEATTRIBUTE VALUE
       
   406 _
       
   407 Availabilityservice/network/smtp/sendmail
       
   408 .TE
       
   409 
       
   410 .SH SEE ALSO
       
   411 .sp
       
   412 .LP
       
   413 \fBpasswd\fR(1), \fBuucp\fR(1C), \fBvacation\fR(1), \fBndbm\fR(3C), \fBgetusershell\fR(3C), \fBpasswd\fR(5), \fBshells\fR(5), \fBattributes\fR(7), \fBnewaliases\fR(8), \fBsendmail\fR(8)
       
   414 .SH NOTES
       
   415 .sp
       
   416 .LP
       
   417 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.
       
   418 .sp
       
   419 .LP
       
   420 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).