System Administration Guide: Resource Management and Network Services

How to Set Up a Mail Server

No special steps are required to set up a mail server that is only serving mail for local users. The user must have an entry in the password file or in the namespace. Also, for mail to be delivered, the user should have a local home directory for checking the ~/.forward file. For this reason, home directory servers are often set up as the mail server. Hardware Components in Chapter 26, Mail Services (Reference) provides more information about the mail server.

The mail server can route mail for many mail clients. This type of mail server must have adequate spooling space for client mailboxes.


Note –

For clients to access their mailboxes, the /var/mail directory should be available for remote mounting. Alternately, a service such as Post Office Protocol (POP) or Internet Message Access Protocol (IMAP) should be available from the server. The following task shows you how to set up a mail server by using the /var/mail directory. To provide configuration guidelines for POP or IMAP is beyond the scope of this document.


For the following task, ensure that the /etc/dfs/dfstab file shows that the /var/mail directory is exported.

  1. Become superuser on the mail server 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. Check if the /var/mail directory is available for remote access.


    # share
    

    If the /var/mail directory is listed, proceed to step 5.

    If the /var/mail directory is not listed or if no list appears, continue with the appropriate substep.

    1. (Optional) If no list appears, start NFS services.

      Follow the procedure, How to Set Up Automatic File-System Sharing, to use the /var/mail directory to start NFS services.

    2. (Optional) If the /var/mail directory is not included in the list, add the directory to /etc/dfs/dfstab.

      Add the following command line to the /etc/dfs/dfstab file.


      share -F nfs -o rw /var/mail
      
  4. Make the file system available for mounting.


    # shareall
    
  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
    

Note –

The mail.local program automatically creates mailboxes in the /var/mail directory the first time a message is delivered. You do not need to create individual mailboxes for your mail clients.