System Administration Guide: Resource Management and Network Services

Administering .forward Files (Tasks)

This section contains several procedures that are related to .forward file administration. Because these files can be edited by users, they can cause problems. For more information, refer to ".forward Files" in Chapter 26, Mail Services (Reference).

How to Disable .forward Files

This procedure, which prevents automated forwarding, disables the .forward file for a particular host.

  1. Become root or assume an equivalent role.

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

  2. Make a copy of /usr/lib/mail/domain/solaris-generic.m4 or your site-specific domain m4 file.


    # cd /usr/lib/mail/domain
    # cp solaris-generic.m4 mydomain.m4
    

    mydomain

    Use the file name of your choice. 

  3. Add the following line to the file you just created.


    define(`confFORWARD_PATH',`')dnl
    

    If a value for confFORWARD_PATH already exists in the m4 file, replace it with this null value.

  4. Build and install a new configuration file.

    If you need help with this step, refer to "How to Build a New sendmail.cf File".

How to Change the .forward File Search Path

If, for example, you want to put all .forward files in a common directory, follow these instructions.

  1. Become root or assume an equivalent role.

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

  2. Make a copy of /usr/lib/mail/domain/solaris-generic.m4 or your site-specific domain m4 file.


    # cd /usr/lib/mail/domain
    # cp solaris-generic.m4 mydomain.m4
    

    mydomain

    Use the file name of your choice. 

  3. Add the following line to the file that you just created.


    define(`confFORWARD_PATH',`$z/.forward:/var/forward/$u')dnl

    If a value for confFORWARD_PATH already exists in the m4 file, replace it with this new value.

  4. Build and install a new configuration file.

    If you need help with this step, refer to "How to Build a New sendmail.cf File".

How to Create and Populate /etc/shells

This file is not included in the standard release, so you must add it if users are to be allowed to use .forward files to forward mail to a program or to a file. You can create the file manually by using grep to identify all of the shells that are listed in your password file. You can then type the shells into the file. However, it is easier to use the following procedure, which employs a script that can be downloaded.

  1. Download the script.

    http://www.sendmail.org/vendor/sun/gen-etc-shells.html

  2. Become root or assume an equivalent role.

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

  3. To generate a list of shells, run the gen-etc-shells script.


    # ./gen-etc-shells.sh > /tmp/shells
    

    This script uses the getent command to collect the names of shells that are included in the password file sources that are listed in /etc/nsswitch.conf.

  4. Inspect and edit the list of shells in /tmp/shells.

    With the editor of your choice, remove any shells that you are not including.

  5. Move the file to /etc/shells.


    # mv /tmp/shells /etc/shells