System Administration Guide, Volume 3

How 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 connects your systems to the outside world or to a parent domain.

  1. Become superuser on the mail host system.

  2. Verify the host name configuration.

    Run the check-hostname script to verify if sendmail will be able to identify the fully qualified host name for this server:


    % /usr/lib/mail/sh/check-hostname
    hostname phoenix OK: fully qualified as phoenix.eng.acme.com

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

  3. Update/etc/hosts.

    Use admintool to edit the /etc/hosts file. Add the word mailhost and mailhost.domainname after the IP address and system name of the mail host system. The system is designated as a mail host. The domainname should be identical to the string given as the subdomain name in the output of the following command:


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

    Here is an example of how the hosts file should look after these changes:


    # cat /etc/hosts
    #
    # Internet host table
    #
    127.0.0.1       localhost        
    129.0.0.1       phoenix mailhost mailhost.eng.acme.com        loghost
  4. Create an entry for the new mail host in the appropriate hosts file.

    If you are using NIS or NIS+, add an entry including a host alias called mailhost and mailhost.domainname to the host entry for the new mail host.

    If you are not using NIS or NIS+, you must create an entry in /etc/hosts for each system on the network. The entry should use this format: IP_address mailhost_name mailhost mailhost.domainname

  5. Change the correct configuration file.

    This command copies and renames the /etc/mail/main.cf file.


    # cp /etc/mail/main.cf /etc/mail/sendmail.cf
    
  6. Restart sendmail and test your mail configuration.

    See "How to Test the Mail Configuration" for information.