Creating Mail Aliases

The mail hub for each DNS domain or subdomain must have a complete list of aliases for all users in that DNS domain. The mail hub for the domain uses these aliases to properly deliver e-mail for users in that domain. Mail aliases must be unique within a domain.

This section describes how to create mail aliases for NIS+, for NIS, or on the local system. Use the aliasadm command to create, modify, and delete aliases from a command line. See the aliasadm(1M) manual page for more information.

Listing the Contents of an NIS+ mail_aliases Table

Use the aliasadm command to list the contents of an NIS+ aliases table. To use the aliasadm command, you must be root, a member of the NIS+ group that owns the mail_aliases table, or the person who created the table.

To list all of the NIS+ mail_aliases entries, type aliasadm -l and press Return.

NOTE

If you have a large aliases table, listing the contents can take some time. To search for a specific entry, pipe the output through the grep command (aliasadm -l | grep entry).


You can use the aliasadm -m alias option to list individual entries in the NIS+ mail_aliases table. The -m option matches only the complete alias name. It does not match partial strings.

The following example lists the alias entry for user ignatz.

# aliasadm -m ignatz
ignatz: ignatz@paperbark  # Alias for Iggy Ignatz
#

Creating a New NIS+ mail_aliases Table

If the mail_aliases table does not exist, you must first initiate it. To initiate a new mail_aliases table, type aliasadm -I and press Return.

Adding Aliases to an NIS+ mail_aliases Table

Use the aliasadm command to add aliases to an existing NIS+ mail_aliases table.

Use the following steps to add aliases to an NIS+ mail_aliases table.

1.
Compile a list of each of your mail clients, the location of their mailboxes, and the name of the mail server systems.

2.
Become superuser on any system.

3.
For each alias, type aliasadm -a alias expanded-alias [options "comments"] and press Return.

Each alias is added to the NIS+ aliases table. The following example adds an alias for user iggy.

# aliasadm -a iggy iggy.ignatz@paperbark "Iggy Ignatz"
								

4.
Type aliasadm -m alias and press Return.

The entry you created is displayed.

5.
Check to make sure the entry is correct.

If you are adding many aliases, you can edit the NIS+ table directly with the aliasadm -e command.

Use the following steps to edit the NIS+ mail_aliases table directly.

1.
Compile a list of each of your mail clients, the location of their mailboxes, and the name of the mail server systems.

2.
Become superuser on any system.

3.
Type aliasadm -e and press Return.

The aliases table is displayed in the editor program specified with the $EDITOR environment variable. If this variable is not set, vi is the default editor.

4.
Type each alias on a separate line, using the format alias expanded-alias # ["options" # "comments"]. If you leave the options column blank, type an empty pair of quotation marks ("") and then add the comments. Press Return at the end of each line.

You can enter the aliases in any order. The order of the aliases is not important to the NIS+ mail_aliases table. The aliasadm -l command sorts the list and displays it in alphabetical order.

5.
Check to make sure the entry is correct.

6.
Save the changes.

Changing Aliases in an NIS+ mail_aliases Table

Use the aliasadm command to modify aliases in an existing NIS+ mail_aliases table.

Use the following steps to modify aliases to an NIS+ mail_aliases table.

1.
Become superuser on any system.

2.
Type aliasadm -m alias and press Return.

The information for the alias is displayed.

3.
Type aliasadm -c alias expanded-alias [options "comments"] and press Return.

The alias is changed using the new information you provide.

4.
Type aliasadm -m alias and press Return.

The information for the alias is displayed.

5.
Check to make sure the entry is correct.

Deleting Entries from an NIS+ mail_aliases Table

Use the aliasadm -d command to delete aliases in an existing NIS+ mail_aliases table.

Use the following steps to delete aliases from an NIS+ mail_aliases table.

1.
Become superuser on any system.

2.
Type aliasadm -d alias and press Return.

The alias is deleted from the NIS+ mail_aliases table.

Setting Up the NIS mail.aliases Map

This section describes how to set up mail aliases on an NIS master server.

The /etc/mail/aliases file on a Solaris NIS master contains all of the names by which a system or person is known. The NIS master is searched if there is no match in the local /etc/aliases or /etc/mail/aliases file.

The sendmail program uses the NIS master file to determine mailing addresses. See the aliases(5) manual page for more information.

The /etc/mail/aliases file on the NIS master should contain entries for all of the mail clients. You edit the file on the NIS master server and propagate the changes to NIS slave systems.


Aliases have the following form.

							name: name1, name2,...
						

You can alias local names or domains. For example, an alias entry for the user fred, who has a mailbox on the system oak and is in the domain Trees, would have the following entry in the /etc/aliases file.

fred: fred@Trees

Use the following steps to set up the NIS mail.aliases map.

1.
Compile a list of each of your mail clients, the locations of their mailboxes, and the names of the mail server systems.

2.
Become superuser on the NIS master server.

3.
Edit the /etc/aliases file and make the following entries.

  • Add an entry for each mail client.

  • Change the entry Postmaster: root to the mail address of the person who is designated as postmaster. See “Setting Up the Postmaster Alias” for more information.

  • If you have created a mailbox for the administration of a mail server, create an entry for root: mailbox@mailserver.

  • Save the changes.

4.
Edit the /etc/hosts file on the NIS master server and create an entry for each mail server.

5.
Type cd /var/yp and press Return.

6.
Type make and press Return.

The changes in the /etc/hosts and /etc/aliases files are propagated to NIS slave systems. It takes a few minutes, at most, for the aliases to take effect.

Setting Up Local Mail Alias Files

The /etc/mail aliases file on a local Solaris system contains all of the names by which a system or person is known. The sendmail program uses this file to look up mailing addresses. See the aliases(5) manual page for more information.

The /etc/mail/aliases file of each system should contain entries for all mail user accounts. You can either edit the file on each system or edit the file on one system and copy it to each of the other systems.

You can use the SMC Users: Mailing Lists tool—available in the Solaris 8 Update 3 release—to edit local /etc/mail/aliases files.


Use the following steps to set up local mail aliases files with the SMC Users, Mailing Lists tool.

1.
Compile a list of each of your mail clients and the locations of their mailboxes.

2.
From the CDE Applications menu, open the Application Manager.

The Application Manager window is opened, as shown in Figure 9.

Figure 9. Application Manager Window


You can also access SMC from the Tools menu on the CDE Front Panel.

3.
Double-click on the Solaris Management Console icon.

The Solaris Management Console window is displayed, as shown in Figure 10.

Figure 10. Solaris Management Console Window


4.
From the Console menu, choose Open Toolbox.

The Open Toolbox window is displayed, as shown in Figure 11.

Figure 11. Open Toolbox Window


5.
Type the name of the mail server or click on the name of the mail server in the list and then click on the Load button.

The toolbox for the system you chose is displayed.

6.
Click on the control to the left of the This Computer icon, then click on the control next to the System Configuration item in the navigation pane.

The Users tool is displayed. Figure 12 shows all of the SMC tools in the navigation pane.

Figure 12. SMC Tools


7.
Double-click on the Users icon.

The Users Login window is displayed, as shown in Figure 13.

Figure 13. Users Login Window


8.
Log in with your user name if you have rights to edit mail aliases, as a role name that has rights to edit mail aliases, or as root, and type the appropriate password.

See Chapter 23, “Role-Based Access Control,” if you need more information about rights.

After a few moments, the Users tools are displayed in the right pane, as shown in Figure 14.

Figure 14. Users Tools


9.
Double-click on the Mailing Lists icon.

The mailing lists for this computer are displayed, as shown in Figure 15.

Figure 15. Mailing Lists


10.
From the Action menu, choose Add Mailing List.

The Add Mailing List window is displayed, as shown in Figure 16.

Figure 16. Users Tools


11.
Add an entry for each mail user account and click on the OK button.

12.
In the Mailing Lists window, double-click on the Postmaster mailing list.

The properties for the Postmaster alias are displayed.

13.
Change the entry for Postmaster from root to the mail address of the person who is designated as postmaster and click on the OK button.

See “Setting Up the Postmaster Alias” for more information.

14.
If you have created a mailbox for the administration of a mail server, create a new mailbox entry for root with the address mailbox@mailserver.

It is a good idea to create an administrative account for each mail server. You do this by assigning root a mailbox on the mail server and adding an entry to the /etc/mail/aliases file for root. For example, if the system paperbark is a mailbox server, add a root mailbox with the address sysadmin@paperbark.

An alias file is created in binary form that sendmail can use. The file is stored in the /etc/mail/aliases.dir and /etc/mail/aliases.pag files.

15.
Use the rpc or rdist commands, a script that you create for this purpose to copy the /etc/mail/aliases, /etc/mail/aliases.dir, and /etc/mail/aliases.pag files to each of the other systems. Alternatively, use the SMC Mailing Lists tool to create the /etc/mail/aliases files on each of the other systems.

Remember that you must update all of the /etc/mail/aliases files each time you add or remove a mail client.

Configuring Hosts to Use DNS Mail Exchange Records

The DNS nameservice does not use aliases for individuals. It does use aliases for hosts or domains, which are called Mail Exchange (MX) records.. The /etc/named.boot file on the DNS server(s) for the domain or subdomain contains a list of other configuration files in DNS, one of which contains MX host information. You can specify host names or domain names in this file. Domain names can contain wildcards; for example, *.sun.com is an acceptable domain name.

NOTE

Releases before Solaris 2.4 included a binary called sendmail.mx that was used with the DNS nameservice. sendmail.mx is now included in the sendmail program; you turn the functionality on by adding the dns flag to the hosts entry in the /etc/nsswitch.conf file.


Use the following steps to enable DNS host and MX record lookups for a host that already uses the NIS+ nameservice.


1.
Become superuser.

2.
Edit the /etc/nsswitch.conf file and remove the comment (#) from the hosts definition.

3.
Add the dns flag after nisplus in the hosts entry, as shown below.

hosts:   nisplus dns []NOTFOUND=return] files

Setting Up the Postmaster Alias

Every system should be able to send mail to a postmaster mailbox. You can create an NIS or NIS+ alias for postmaster or create one in each local /etc/mail/aliases file. The following example shows the default /etc/mail/aliases entry.

# Following alias is required by the mail protocol, RFC 822
# Set it to the address of a HUMAN who deals with this system's mail problems.
Postmaster: root

To create the postmaster alias, edit each system's /etc/mail/aliases file and change root to the mail address of the person who will act as the postmaster.

You may want to create a separate mailbox for the postmaster to keep postmaster mail separate from personal mail. If you create a separate mailbox, use the mailbox address instead of the postmaster's mail address when you edit the /etc/mail/aliases files.

Follow these steps to create a separate mailbox for the postmaster.

1.
Create a user account named postmaster and put an asterisk (*) in the password field.

2.
Type mail -f postmaster and press Return.

Mail can be read and written to the mailbox name.

Follow these steps to add the postmaster mailbox to the alias.

1.
Become superuser and edit the /etc/mail/aliases file on each system.

You can use the SMC Users: Mailing Lists tool to edit the /etc/mail/aliases file. See “Setting Up Local Mail Alias Files” for more information.

2.
Change the postmaster alias from root to Postmaster: postmastermailbox@postmasterhost and save the changes.

3.
On the postmaster's local system, create an entry in the /etc/mail/aliases file that defines the name of the alias (postmaster, for example) and includes the path to the local mailbox.

4.
Type newaliases and press Return.

Alternatively, you could change the Postmaster: entry in the aliases file to Postmaster: /usr/somewhere/somefile.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.76.200