Sun Microsystems Logo
Products and Services
 
Support and Training
 
 

Previous Previous     Contents     Index     Next Next

ProcedureHow 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. The changes are active in only a few minutes, at most.

ProcedureHow to Set Up a Local Mail Alias File

Use the following procedure to resolve aliases with a local mail alias file.

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

  2. 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. Edit the /etc/mail/aliases file and make the following entries.

    1. Add an entry for each user.

      user1: user2@host.domain

      user1

      Use the new alias name.

      user2@host.domain

      Use the actual address for the new alias.

    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. Rebuild the alias database.

    # newaliases

    The configuration of the AliasFile option in /etc/mail/sendmail.cf determines whether this command generates in binary form either the single file, /etc/mail/aliases.db, or the pair of files, /etc/mail/aliases.dir and /etc/mail/aliases.pag.

  5. Perform one of the following steps to copy the file or files that were generated.

    1. (Optional) Copy the /etc/mail/aliases, the /etc/mail/aliases.dir, and the/etc/mail/aliases.pag files to each of the other systems.

      You can copy the three files by using the rcp or rdist commands. Refer to the rcp(1) man page or the rdist(1) man page for more information. Alternately, you can create a script for this purpose.

      When you copy these files, you do not need to run the newaliases command on each of the other systems. However, remember that you must update all the /etc/mail/aliases files each time you add or remove a mail client.

    2. (Optional) Copy the /etc/mail/aliases.db file to each of the other systems.

      You can copy the file by using the rcp or rdist commands. Refer to the rcp(1) man page or the rdist(1) man page for more information. Alternately, you can create a script for this purpose.

      When you copy this file, you do not need to run the newaliases command on each of the other systems. However, remember that you must update all the /etc/mail/aliases files each time you add or remove a mail client.

ProcedureHow to Create a Keyed Map File

To create a keyed map file, follow these instructions.

  1. Become superuser 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. Create an input file.

    Entries can have the following syntax.

    old_name@newdomain.com   new_name@newdomain.com
    old_name@olddomain.com    error:nouser No such user here
    @olddomain.com          %1@newdomain.com

    old_name@newdomain.com

    Use the user name that was previously assigned with the domain that is newly assigned.

    new_name@newdomain.com

    Use the address that is newly assigned.

    old_name@olddomain.com

    Use the user name that was previously assigned with the domain that was previously assigned.

    olddomain.com

    Use the domain that was previously assigned.

    newdomain.com

    Use the domain that is newly assigned.

    The first entry redirects mail to a new alias. The next entry creates a message when an incorrect alias is used. The last entry redirects all incoming mail from olddomain to newdomain.

  3. Create the database file.

    # /usr/sbin/makemap maptype newmap < newmap

    maptype

    Select a database type, such as dbm, btree, or hash.

    newmap

    Use the name of the input file and the first part of the name of the database file. If the dbm database type is selected, then the database files are created by using a .pag and a .dir suffix. For the other two database types, the file name is followed by .db.

Previous Previous     Contents     Index     Next Next