Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
25.  Mail Services (Tasks) Administering Mail Alias Files (Tasks) How to Manage Alias Entries in an NIS+ mail_aliasesTable Example--Listing Partial Matches From the NIS+ mail_aliases Table  Previous   Contents   Next 
   
 

Example--Adding Aliases to the NIS+ mail_aliases Table From the Command Line

To add two or three aliases to the table, follow these instructions.

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

  2. 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.

  3. (Optional)

    If necessary, initiate an NIS+ table.

    If you are creating a completely new NIS+ mail_aliases table, you must first initiate the table. To complete this task, refer to "Example--Initiating an NIS+ mail_aliases Table".

  4. Add aliases to the table.

    See this example of a typical entry.

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

    The following list describes the input from the preceding example.

    -a

    The option for adding an alias

    iggy

    The short form of the alias name

    iggy.ignatz@saturn

    The expanded alias name

    "Iggy Ignatz"

    The name for the alias in quotation marks

  5. Display the entry you created and ensure that it is correct.

    # aliasadm -m alias

    alias

    The entry that you created

For more information, refer to the aliasadm(1M) man page.

Example--Adding Entries by Editing an NIS+ mail_aliases Table

To add more than two or three aliases to the table, follow these instructions.

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

  2. 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.

  3. Display and edit the aliases table.

    # aliasadm -e

    This command displays the table and enables you to edit it. The editor you use has been set with the $EDITOR environment variable. If this variable is not set, vi is the default editor.

  4. Use the following format to type each alias on a separate line.

    alias: expanded_alias # ["option" # "comments"]

    alias

    This column is for the short form of the alias name.

    expanded_alias

    This column is for the expanded alias name.

    option

    This column is reserved for future use.

    comments

    This column is used for comments about the individual alias, such as a name for the alias.

    If you leave the option column blank, type an empty pair of quotation marks ("") and add the comments.

    The order of the entries is not important to the NIS+ mail_aliases table. The aliasadm -l command sorts the list and displays the entries in alphabetical order.

    For more information, refer to "Mail Alias Files" and the aliasadm(1M) man page.

Example--Editing Entries in an NIS+ mail_aliases Table

To edit entries in the table, follow these instructions.

  1. 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.

  2. Display the alias entry.

    # aliasadm -m alias

    alias

    Use the assigned alias name.

  3. Edit the alias entry, as necessary.

    # aliasadm -c alias expanded_alias [options comments]

    alias

    If necessary, edit the alias name.

    expanded_alias

    If necessary, edit the expanded alias name.

    options

    If necessary, edit the option.

    comments

    If necessary, edit the comment for this entry.

    For more information, refer to the aliasadm(1M) man page, as well as "Mail Alias Files".

  4. Display the entry that you have edited and ensure that the entry is correct.

    # aliasadm -m alias

For more information, refer to the aliasadm(1M) man page.

Example--Deleting Entries From an NIS+ mail_aliases Table

To delete entries from the table, follow these instructions.

  1. 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.

  2. Delete an entry from the table.

    # aliasadm -d alias

    alias

    Use the alias name for the entry that you are deleting.

For more information, refer to the aliasadm(1M) man page.

How to Set Up an NIS mail.aliases Map

Use the following procedure to facilitate aliasing with an 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 root on the NIS master server or assume an equivalent role.

    For information about roles, refer to "Using Privileged Applications" in System Administration Guide: Security Services.

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

    1. Add an entry for each mail client.

      # cat /etc/mail/aliases
      ..
      alias:expanded_alias

      alias

      Use the short alias name.

      expanded_alias

      Use the expanded alias name (user@host.domain.com).

    2. Ensure that you have a Postmaster: root entry.

      # cat /etc/mail/aliases
      ..
      Postmaster: root
    3. Add an alias for root. Use the mail address of the person who is designated as the postmaster.

      # cat /etc/mail/aliases
      ..
      root: user@host.domain.com

      user@host.domain.com

      Use the assigned address of the designated postmaster.

  4. Ensure that the NIS master server is running a name service to resolve the host names on each mail server.

  5. Change to the /var/yp directory.

    # cd /var/yp
  6. Apply the make command.

    # make

    The changes in the /etc/hosts and /etc/mail/aliases files are propagated to NIS slave systems and are active in only a few minutes, at most.

 
 
 
  Previous   Contents   Next