System Administration Guide: Network Services

ProcedureHow to Set Up a Mail Client

A mail client is a user of mail services with a mailbox on a mail server. Additionally, the mail client has a mail alias in the /etc/mail/aliases file that points to the location of the mailbox.


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.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services. To configure a role with the Primary Administrator profile, see Chapter 2, Working With the Solaris Management Console (Tasks), in System Administration Guide: Basic Administration.

  2. Stop sendmail.


    # svcadm disable -t network/smtp:sendmail
    
  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 that 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 whenever the system is rebooted. If you are not rebooting the system, type the following command to mount the client mailbox.


      # mountall
      

      Caution – 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 that 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.


    # svcadm enable network/smtp:sendmail