Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
25.  Mail Services (Tasks) Setting Up Mail Services (Task Map)  Previous   Contents   Next 
   
 

Setting Up Mail Services (Tasks)

You can readily set up a mail service if your site does not provide connections to email services outside your company or if your company is in a single domain.

Mail requires two types of configurations for local mail. Refer to Figure 25-1 in "Local Mail Only" for a representation of these configurations. Mail requires two more configurations for communication with networks outside your domain. Refer to Figure 24-1 in "Overview of the Hardware Components" or Figure 25-2 in "Local Mail and a Remote Connection" for a representation of these configurations. You can combine these configurations on the same system or provide them on separate systems. For example, if your mail host and mail server functions are on the same system, follow the directions in this section for setting up that system as a mail host. Then, follow the directions in this section for setting up the same system as a mail server.


Note - The following procedures for setting up a mail server and mail client apply when mailboxes are NFS mounted. However, mailboxes typically are maintained in locally mounted /var/mail directories, which eliminates the need for the following procedures.


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 name space, and the user should have a local home directory (for checking the ~/.forward file) for mail to be delivered. 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. The only resource requirement for this type of mail server is that it have adequate spooling space for client mailboxes.


Note - Either the /var/mail directory should be available for remote mounting or a service such as Post Office Protocol (POP) or Internet Message Access Protocol (IMAP) should be available from the server for clients to access their mailboxes. 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 it 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.


How to Set Up a Mail Client

A mail client is a user of mail services with a mailbox on a mail server and a mail alias in the /etc/mail/aliases file that points to the location of the mailbox. "Hardware Components" in Chapter 26, Mail Services (Reference) provides a brief description of a mail client.


Note - You can also perform the task of setting up a mail client by using a service such as Post Office Protocol (POP) or Internet Message Access Protocol (IMAP). However, to provide configuration guidelines for POP or IMAP is beyond the scope of this document.


  1. Become superuser on the mail client's system 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. Ensure that a /var/mail mount point exists on the mail client's system.

    The mount point should have been created during the installation process. You can use ls to ensure that the file system exists. The following example shows the response you receive if the file system has not been created.

    # ls -l /var/mail
    /var/mail not found
  4. Ensure that no files are in the /var/mail directory.

    If mail files do exist in this directory, you should move them so that they are not covered when the /var/mail directory is mounted from the server.

  5. Mount the /var/mail directory from the mail server.

    You can mount the mail directory automatically or at boot time.

    1. (Optional)

      Mount /var/mail automatically.

      Add an entry such as the following to the /etc/auto_direct file.

      /var/mail -rw,hard,actimeo=0 server:/var/mail

      server

      Use the assigned server name.

    2. (Optional)

      Mount /var/mail at boot time.

      Add the following entry to the /etc/vfstab file. This entry permits the /var/mail directory on the mail server that is specified to mount the local /var/mail directory.

      server:/var/mail - /var/mail nfs - no rw,hard,actimeo=0

      The client's mailbox is automatically mounted any time the system is rebooted. If you are not rebooting the system, type the following command to mount the client mailbox.

      # mountall

      Caution - For mailbox locking and mailbox access to work properly, you must include the actimeo=0 option when mounting mail from an NFS server.


  6. Update /etc/hosts.

    Edit the /etc/hosts file and add an entry for the mail server. This step is not required if you are using a name service.

    # cat /etc/hosts
    #
    # Internet host table
    #
    ..
    IP_address     mailhost  mailhost  mailhost.example.com

    IP_address

    Use the assigned IP addresses.

    example.com

    Use the assigned domain.

    mailhost

    Use the assigned mailhost.

    For more information, refer to the hosts(4) man page.

  7. Add an entry for the client to one of the alias files.

    Refer to "Administering Mail Alias Files (Task Map)" for a task map about administering mail alias files.


    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.


  8. Restart sendmail.

    # /etc/init.d/sendmail start
 
 
 
  Previous   Contents   Next