System Administration Guide, Volume 3

Building a sendmail Configuration File

The process to create sendmail configuration files has been changed. For many sites, This change should assist the administration of the configuration files. Although it is still acceptable to use an older version of sendmail.cf files, it would be best to move to the new system as soon as is reasonable. A complete description of the new process is described in /usr/lib/mail/README.

How to Build a New sendmail.cf File

  1. Become superuser.

  2. Make a copy of the configuration files that you want to change.


    # cd /usr/lib/mail/cf
    # cp main-v7sun.mc myhost.mc
    
  3. Edit the new configuration files as needed (for example myhost.mc).

  4. Build the configuration file using m4.


    # /usr/ccs/bin/make myhost.cf
    
  5. Test the new configuration file using the -C option to specify the new file.


    # /usr/lib/sendmail -C myhost.cf -v testaddr </dev/null
    

    This command sends a message to testaddr while displaying messages as it runs. Only outgoing mail can be tested without restarting the sendmail service on the system. For systems that are not handling mail yet, use the full testing procedure found in "How to Test the Mail Configuration".

  6. (Optional) Install the new configuration file, after making a copy of the original.


    # cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.save
    # cp myhost.cf /etc/mail/sendmail.cf
    
  7. Restart the sendmail service.


    # pkill -HUP sendmail