System Administration Guide: Network Services

ProcedureHow to Set Up a Mail Host

A mail host resolves email addresses and reroutes mail within your domain. A good candidate for a mail host is a system that provides your network with a remote connection or connects your network to a parent domain. The following procedure shows you how to set up a mail host.

  1. Become superuser on the mail host system or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Stop sendmail.


    # svcadm disable -t network/smtp:sendmail
    
  3. Verify the host-name configuration.

    Run the check-hostname script to verify that sendmail can identify the fully qualified host name for this server.


    % /usr/sbin/check-hostname
    hostname phoenix OK: fully qualified as phoenix.example.com

    If this script is not successful in identifying the fully qualified host name, you need to add the fully qualified host name as the first alias for the host in /etc/hosts.

  4. Update the /etc/hosts file.

    Choose the step that is appropriate for you.

    1. (Optional) If you are using NIS or NIS+, edit the /etc/hosts file on the system that is to be the new mail host.

      Add the word mailhost and mailhost.domain after the IP address and system name of the mail host system.


      IP-address mailhost mailhost mailhost.domain loghost
      IP-address

      Use the assigned IP address.

      mailhost

      Use the system name of the mail host system.

      domain

      Use the expanded domain name.

      The system is now designated as a mail host. The domain should be identical to the string that is given as the subdomain name in the output of the following command.


      % /usr/lib/sendmail -bt -d0 </dev/null
      Version 8.13.1+Sun
       Compiled with: LDAPMAP MAP_REGEX LOG MATCHGECOS MIME7TO8 MIME8TO7
                      NAMED_BIND NDBM NETINET NETINET6 NETUNIX NEWDB NIS
                      NISPLUS QUEUE SCANF SMTP USERDB XDEBUG
      
      ============ SYSTEM IDENTITY (after readcf) ============
            (short domain name) $w = phoenix
        (canonical domain name) $j = phoenix.example.com
               (subdomain name) $m = example.com
                    (node name) $k = phoenix
      ========================================================

      See the following example of how the hosts file should look after these changes.


      # cat /etc/hosts
      #
      # Internet host table
      #
      172.31.255.255   localhost        
      192.168.255.255  phoenix mailhost mailhost.example.com loghost
    2. (Optional) If you are not using NIS or NIS+, edit the /etc/hosts file on each system in the network.

      Create the following entry.


      IP-address mailhost mailhost mailhost.domain loghost
  5. Restart sendmail.


    # svcadm enable network/smtp:sendmail
    
  6. Test your mail configuration.

    See How to Test the Mail Configuration for instructions.


    Note –

    For further information about mail hosts, refer to Hardware Components in Chapter 14, Mail Services (Reference).