Administering Mail Alias Files (Task Map)
The following table describes the procedures for administering mail alias files. For more information on this topic, refer to "Mail Alias Files" in Chapter 26, Mail Services (Reference).
Task | Description | For Instructions |
---|---|---|
Managing alias entries in an NIS+ mail_aliases table | If your name service is NIS+, use these procedures to manage the contents of your mail_aliases table. Learn how to list, add, edit, and delete entries. | |
Setting up an NIS mail.aliases map | If your name service is NIS, follow these instructions to facilitate aliasing with a mail.aliases map. | |
Setting up a local mail alias file | If you are not using a name service (such as NIS or NIS+), follow these instructions to facilitate aliasing with the /etc/mail/aliases file. | |
Creating a keyed map file | Use these steps to facilitate aliasing with a keyed map file. | |
Setting up the postmaster alias | Use the procedures in this section to manage the postmaster alias. You must have this alias. |
Administering Mail Alias Files (Tasks)
Mail aliases must be unique within the domain. This section provides the procedures for administering mail alias files. Alternately, you can use the AdminTool's Database Manager application to perform these tasks on the aliases database.
In addition, you can create database files for the local mail host by using makemap. Refer to the makemap(1M) man page. The use of these database files does not provide all of the advantages of using a name service such as NIS or NIS+. However, you should be able to retrieve the data from these local database files faster because no network lookups are involved. For more information, refer to "Interactions of sendmail With Name Services" and "Mail Alias Files" in Chapter 26, Mail Services (Reference).
How to Manage Alias Entries in an NIS+ mail_aliases Table
To manage entries in an NIS+ table, you can use the aliasadm command. To list, add, modify, or delete table entries with the aliasadm command, you begin a particular task with the following steps.
Either be a member of the NIS+ group that owns the table, or become root on the mail server, or assume an equivalent role.
For information about roles, refer to "Using Privileged Applications" in System Administration Guide: Security Services.
Complete your task by following the instructions from the example that meets your requirements.
"Example--Listing the Entire Contents of the NIS+ mail_aliases Table"
"Example--Listing an Individual Entry From the NIS+ mail_aliases Table"
"Example--Listing Partial Matches From the NIS+ mail_aliases Table"
"Example--Adding Aliases to the NIS+ mail_aliasesTable From the Command Line"
"Example--Adding Entries by Editing an NIS+ mail_aliases Table"
In some instances, you should begin the task by compiling a list of each of your mail clients, the locations of their mailboxes, and the names of the mail server systems.
Example--Initiating an NIS+ mail_aliases Table
To create a table, follow these instructions.
Either be a member of the NIS+ group that owns the table, or become root on the mail server, or assume an equivalent role.
For information about roles, refer to "Using Privileged Applications" in System Administration Guide: Security Services.
Initiate an NIS+ table.
# aliasadm -I
Add entries to the table.
To add two or three aliases, refer to "Example--Adding Aliases to the NIS+ mail_aliasesTable From the Command Line".
To add more than two or three aliases, refer to "Example--Adding Entries by Editing an NIS+ mail_aliases Table".
For more information, refer to the aliasadm(1M) man page.
Example--Listing the Entire Contents of the NIS+ mail_aliases Table
To see a complete list of the contents of the table, follow these instructions.
Either be a member of the NIS+ group that owns the table, or become root on the mail server, or assume an equivalent role.
For information about roles, refer to "Using Privileged Applications" in System Administration Guide: Security Services.
List all of the entries in alphabetical order by alias.
# aliasadm -1
For more information, refer to the aliasadm(1M) man page.
Example--Listing an Individual Entry From the NIS+ mail_aliases Table
To see an individual entry from the table, follow these instructions.
Either be a member of the NIS+ group that owns the table, or become root on the mail server, or assume an equivalent role.
For information about roles, refer to "Using Privileged Applications" in System Administration Guide: Security Services.
List an individual entry.
# aliasadm -m ignatz ignatz: ignatz@saturn # Alias for Iggy Ignatz
The command matches only the complete alias name, not partial strings. You cannot use metacharacters (such as * and ?) with aliasadm -m.
For more information, refer to the aliasadm(1M) man page.
Example--Listing Partial Matches From the NIS+ mail_aliases Table
To see partial matches from the table, follow these instructions.
Either be a member of the NIS+ group that owns the table, or become root on the mail server, or assume an equivalent role.
For information about roles, refer to "Using Privileged Applications" in System Administration Guide: Security Services.
List partial matches from the table.
# aliasadm -l | grep partial_string
partial_string
Use the string of your choice for your search.
For more information, refer to the aliasadm(1M) man page.