Mail Administration Guide

How to Build a New sendmail.cf File

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


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

  3. Build the configuration file using m4.


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


    # /usr/lib/sendmail -C /usr/lib/mail/cf/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".

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


    # cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.save
    # cp /usr/lib/mail/cf/myhost.cf /etc/mail/sendmail.cf
    
  6. Restart the sendmail service.


    # pkill -HUP sendmail