System Administration Guide, Volume 3

Administering .forward Files

This section contains several procedures related to .forward file administration. Because these files can be edited by users, the files can cause problems.

How to Disable .forward Files

This procedure disables .forward files only for a particular host.

  1. Become root.

  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
    
  3. Add the following line to the file you just created:


    define(`confFORWARD_PATH',`')dnl

    If a line already exists in the domain m4 file that you are using, replace the line.

  4. Build and install a new configuration file.

    See "How to Build a New sendmail.cf File" for a complete procedure.

How to Change the .forward File Search Path

  1. Become root.

  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
    
  3. Add a line like the following to the file you just created:


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

    If a line already exists in the domain m4 file that you are using, replace the line.

  4. Build and install a new configuration file.

    See "How to Build a New sendmail.cf File" for a complete procedure.

How to Create and Populate /etc/shells

This file is not included in the standard release, so it must be added 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 by hand by using grep to identify all of the shells listed in your password file, then enter them manually in the file, but it is easier to use the following procedure, which employs a script that can be downloaded.

  1. Download the script from http://www.sendmail.org/sun-specific/gen-etc-shells.html.

  2. Become root.

  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 included in the password file sources listed in /etc/nsswitch.conf.

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

    Using the editor of your choice, remove any shells that you do not want included.

  5. Move the file to /etc/shells.


    # mv /tmp/shells /etc/shells