Mail Administration Guide

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 root on the mail host system.

  2. Verify the hostname configuration.

    Run the check-hostname script to verify if sendmail will be able to identify the fully qualified hostname 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 hostname, you need to add the fully qualified hostname as the first alias for the host in /etc/hosts.

  3. Use the Administration Tool 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 subdomainname in the output of this command: /usr/lib/sendmail -bt -d0 </dev/null.


    % /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
    ========================================================
  4. Create an entry for the new mail host in one of the hosts files.

    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. Type cp /etc/mail/main.cf /etc/mail/sendmail.cf and press Return.

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

  6. Restart sendmail and test your mail configuration.

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