System Administration Guide: Resource Management and Network Services

How to Set Up a Mail Gateway

A mail gateway manages communication with networks outside your domain. The mailer on the sending mail gateway can match the mailer on the receiving system.

A good candidate for a mail gateway is a system that is attached to Ethernet and phone lines or a system that is configured as a router to the Internet. You can configure the mail host or another system as the mail gateway. You might choose to configure more than one mail gateway for your domain. If you have UNIX-to-UNIX Copy Program (UUCP) connections, you should configure the system (or systems) with UUCP connections as the mail gateway.

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

    For information about roles, refer to "Using Privileged Applications" in System Administration Guide: Security Services.

  2. Stop sendmail.


    # /etc/init.d/sendmail stop
    
  3. Select the correct configuration file to copy and rename.

    The following command copies and renames the main.cf file.


    # cp /etc/mail/main.cf /etc/mail/sendmail.cf
    
  4. 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/lib/mail/sh/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. If you need help with this step, refer to Step 4 of "How to Set Up a Mail Host".

  5. Ensure that your name service has been started.

    1. (Optional) If you are running NIS, use this command.


      # ypwhich
      

      For more information, refer to the ypwhich(1) man page.

    2. (Optional) If you are running NIS+, use this command.


      # nisls
      

      For more information, refer to the nisls(1) man page.

    3. (Optional) If you are running DNS, use this command.


      # nslookup hostname
      

      hostname

      Use your host name. 

      For more information, refer to the nslookup(1M) man page.

    4. (Optional) If you are running LDAP, use this command.


      # ldaplist
      

      For more information, refer to the ldaplist(1) man page.

  6. Restart sendmail.


    # /etc/init.d/sendmail start
    
  7. Test your mail configuration

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

For more information about the mail gateway, refer to "Hardware Components" in Chapter 26, Mail Services (Reference).