'\" te .\" Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. .TH aliases 5 "8 Mar 2016" "SunOS 5.12" "File Formats" .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 .sp .LP These files contain mail addresses or aliases, recognized by \fBsendmail\fR(8) for the local host: .sp .ne 2 .mk .na \fB/etc/passwd\fR .ad .sp .6 .RS 4n Mail addresses (usernames) of local users. .RE .sp .ne 2 .mk .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 .mk .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(8). The program \fBnewaliases\fR(8) maintains these files. .RE .sp .ne 2 .mk .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(8). 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(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. .RE .sp .ne 2 .mk .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" .sp .LP As distributed, \fBsendmail\fR(8) supports the following types of addresses: .SS "Local Usernames" .sp .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" .sp .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" .sp .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(8) pipes the message to the standard input of the \fBcommand\fR the bar precedes. .SS "Internet-standard Addresses" .sp .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" .sp .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(8) for details. Standard addresses are recommended. .SS "Aliases" .SS "Local Aliases" .sp .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(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. .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" .sp .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" .sp .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 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. .sp .LP For example, the alias: .sp .in +2 .nf jsmith:root .fi .in -2 .sp .LP sends mail on an \fBNIS\fR client to \fBroot@podunk-u\fR if the name of the \fBNIS\fR domain is \fBpodunk-u\fR. .SS "Automatic Forwarding" .sp .LP 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. .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/bin/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(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. .sp .LP The default value of the \fBForwardPath\fR processing option in \fBsendmail\fR(8) 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(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: .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 .sp .ne 2 .mk .na \fB\fB/etc/passwd\fR\fR .ad .RS 25n .rt Password file .RE .sp .ne 2 .mk .na \fB\fB/etc/nsswitch.conf\fR\fR .ad .RS 25n .rt Name service switch configuration file .RE .sp .ne 2 .mk .na \fB\fB/etc/mail/aliases\fR\fR .ad .RS 25n .rt Mail aliases file (ascii) .RE .sp .ne 2 .mk .na \fB\fB/etc/mail/aliases.db\fR\fR .ad .RS 25n .rt Database of mail aliases (binary) .RE .sp .ne 2 .mk .na \fB\fB/etc/mail/aliases.dir\fR\fR .ad .RS 25n .rt Database of mail aliases (binary) .RE .sp .ne 2 .mk .na \fB\fB/etc/mail/aliases.pag\fR\fR .ad .RS 25n .rt Database of mail aliases (binary) .RE .sp .ne 2 .mk .na \fB\fB/etc/mail/sendmail.cf\fR\fR .ad .RS 25n .rt sendmail configuration file .RE .sp .ne 2 .mk .na \fB\fB~/.forward\fR\fR .ad .RS 25n .rt Forwarding information file .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Availabilityservice/network/smtp/sendmail .TE .SH SEE ALSO .sp .LP \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) .SH NOTES .sp .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).