![]() |
![]() |
| ||||||||||||||||||||
/etc/mail/aliases FileAny alias that is established in the /etc/mail/aliases file can be used by any user who knows the name of the alias and the host name of the system that contains the file. Distribution list formats in a local /etc/mail/aliases file adhere to the following format.
aliasname is the name that the user uses when sending mail to this alias, and value is a valid email address. If your network is not running a name service, the /etc/mail/aliases file of each system should contain entries for all mail clients. You can either edit the file on each system or edit the file on one system and copy the file to each of the other systems. The aliases in the /etc/mail/aliases file are stored in text form. When you edit the /etc/mail/aliases file, you need to run the newaliases program. This program recompiles the database and makes the aliases available in binary form to the sendmail program. For task information, refer to How to Set Up a Local Mail Alias File in Chapter 22, Mail Services (Tasks). Otherwise, you can use the AdminTool's Database Manager to administer the mail aliases that are stored in the local /etc files. You can create aliases for only local names--a current host name or no host name. For example, an alias entry for user ignatz who has a mailbox on the system saturn would have the following entry in the /etc/mail/aliases file.
You should create an administrative account for each mail server. You create such an account by assigning a mailbox on the mail server to root and by adding an entry for root to the /etc/mail/aliases file. For example, if the system saturn is a mailbox server, add the entry root: sysadmin@saturn to the /etc/mail/aliases file. Normally, only the root user can edit this file. However, when you use the AdminTool, all users in group 14, which is the sysadmin group, can change the local file. Another option is to create the following entry.
aliasname is the name that the user uses when sending mail, and /path/aliasfile is the full path to the file that contains the alias list. The alias file should include email entries, one entry on each line, and no other notations.
You can define additional mail files in /etc/mail/aliases to keep a log or a backup copy. The following entry stores all mail that is sent to aliasname in filename.
You can also route the mail to another process. The following example stores a copy of the mail message in filename and prints a copy.
For a task map, refer to Administering Mail Alias Files (Task Map) in Chapter 22, Mail Services (Tasks). NIS aliases MapAll users in a local domain can use the entries that are in the NIS aliases map. The reason is that the sendmail program can use the NIS aliases map instead of the local /etc/mail/aliases files to determine mailing addresses. For more information, refer to the nsswitch.conf(4) man page. Aliases in the NIS aliases map adhere to the following format.
aliasname is the name that the user uses when sending mail, and value is a valid email address. The NIS aliases map should contain entries for all mail clients. In general, only the root user on the NIS master can change these entries. This type of alias might not be a good choice for aliases that are constantly changing. However, such aliases can be useful if the aliases point to another alias file, as in the following syntax example.
aliasname is the name that the user uses when sending mail, and host is the host name for the server that contains an /etc/mail/alias file. For task information, refer to How to Set Up an NIS mail.aliases Map in Chapter 22, Mail Services (Tasks). NIS+ mail_aliases TableThe NIS+ mail_aliases table contains the names by which a system or person is known in the local domain. The sendmail program can use the NIS+ mail_aliases table, instead of the local /etc/mail/aliases files, to determine mailing addresses. Refer to the aliasadm(1M) and nsswitch.conf(4) man pages for more information. Aliases in the NIS+ mail_aliases table adhere to the following format:
Table 23-12 describes the four columns that are in an NIS+ mail_aliases table. Table 23-12 Columns in the NIS+ mail_aliases Table
The NIS+ mail_aliases table should contain entries for all mail clients. You can list, create, modify, and delete entries in the NIS+ aliases table with the aliasadm command. To use the aliasadm command, you must be a member of the NIS+ group that owns the aliases table. For task information, refer to How to Manage Alias Entries in an NIS+ mail_aliasesTable in Chapter 22, Mail Services (Tasks). Alternately, you can use the AdminTool's Database Manager to administer the NIS+ mail aliases. Note - If you are creating a new NIS+ aliases table, you must initialize the table before you create the entries. If the table exists, no initialization is needed. .forward FilesUsers can create a .forward file in their home directories that sendmail, along with other programs, can use to redirect mail or send mail. Refer to the following topics. For a task map, refer to Administering .forward Files (Task Map) in Chapter 22, Mail Services (Tasks). Situations to AvoidThe following list describes some situations that you can avoid or easily fix.
Controls for .forward filesFor the .forward files to be an effective part of mail delivery, ensure that the following controls (mostly permissions settings) are correctly applied.
.forward.hostname FileYou can create a .forward.hostname file to redirect mail that is sent to a specific host. For example, if a user's alias has changed from sandy@phoenix.example.com to sandy@example.com, place a .forward.phoenix file in the home directory for sandy.
In this example, mail can be forwarded to the correct place while the sender is notified of the alias change. Because the vacation program permits only one message file, you can forward only one message at a time. However, if the message is not host specific, one vacation message file can be used by .forward files for many hosts. | ||||||||||||||||||||
| ||||||||||||||||||||