Go to main content

Managing sendmail Services in Oracle® Solaris 11.4

Exit Print View

Updated: November 2020
 
 

How to Build a New sendmail.cf File

  1. Become an administrator.

    For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.4.

  2. Stop the sendmail service.
    # svcadm disable -t network/smtp:sendmail
  3. Make a copy of the original configuration files that you are changing.
    # cd /etc/mail/cf/cf
    # cp sendmail.mc hostname.mc
    hostname

    Select a new name for your .mc file

  4. Edit the new configuration files.

    For example, add the following command line to enable domain masquerading:

    # cat hostname.mc
    ..
    MASQUERADE_AS(`host.domain')
    host.domain

    Use the desired host name and domain name

    In this example, MASQUERADE_AS causes sent mail to be labeled as originating from host.domain, rather than $j.

  5. Build the configuration file by using m4.
    # make hostname.cf
  6. Test the new configuration file.
    # /usr/lib/sendmail -C hostname.cf -v testaddr </dev/null

    While this command displays messages, it sends a message to testaddr. 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. For more information, see Testing a New Mail Configuration.

  7. () Install the new configuration file after making a copy of the original.
    # cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.save
    # cp hostname.cf /etc/mail/sendmail.cf
  8. Restart the sendmail service.
    # svcadm enable network/smtp:sendmail

Next Steps

After you have generated your /etc/mail/sendmail.cf file, you can continue with the next steps to create a virtual user table.