System Administration Guide: Resource Management and Network Services

Chapter 25 Mail Services (Tasks)

This chapter describes how to set up and administer mail services. If you are not familiar with administering mail services, read Chapter 24, Mail Services (Overview) for an introduction to the components of mail services and for a description of a typical mail service configuration (as shown in Figure 24–1). The following list can help you find groups of related procedures that are covered in this chapter.

See Chapter 26, Mail Services (Reference) for a more detailed description of the components of mail services. This chapter also describes the mail service programs and files, the mail routing process, and the interactions of sendmail with name services.

See Chapter 27, What's New With Mail Services (Reference) for a description of the new features that are included in version 8.12 of sendmail, the version that is in this Solaris 9 release. You can also read about changes to mail.local, mailstats, and makemap. Chapter 27, What's New With Mail Services (Reference) also provides a description of a new maintenance command, editmap.

Mail Services Task Map

The following table refers you to task maps throughout this chapter that focus on a specific group of procedures.

Task 

Description 

For Instructions 

Setting up mail services 

Use these procedures to set up each component of your mail service. Learn how to set up a mail server, a mail client, a mail host, a mail gateway, a virtual host, and how to use DNS with sendmail.

Setting Up Mail Services (Task Map)

Building a sendmail configuration file

Use this procedure to modify your sendmail.cf file. See an example of how to enable domain masquerading.

Building the sendmail.cf Configuration File (Task)

Managing mail delivery with an alternate configuration 

Use this procedure to prevent mail delivery problems that can occur if the master daemon is disabled. 

Managing Mail Delivery by Using an Alternate Configuration (Task)

Administering mail alias files 

Use these procedures to provide aliasing on your network. Learn how to manage entries in NIS+ tables. Also, learn how to set up an NIS map, a local mail alias, a keyed map file, and a postmaster alias. 

Administering Mail Alias Files (Task Map)

Administering the mail queue 

Use these procedures to provide smooth queue processing. Learn how to display and move the mail queue, force mail queue processing, run a subset of the mail queue, and how to run the old mail queue. 

Administering the Queue Directories (Task Map)

Administering .forward files

Use these procedures to disable .forward files or change the search path of the .forward file. Also, learn how to permit users to use the .forward file by creating and populating /etc/shells.

Administering .forward Files (Task Map)

Troubleshooting procedures and tips for mail services 

Use these procedures and tips to resolve problems with your mail service. Learn how to test the mail configuration, check mail aliases, test the sendmail rule sets, verify connections to other systems, and log messages. Find out where to look for other mail diagnostic information.

Troubleshooting Procedures and Tips for Mail Services (Task Map)

Resolving error messages 

Use the information in this section to resolve some mail-related error messages. 

Resolving Error Messages

Planning Your Mail System

The following list describes some concerns that should be part of your planning process.

After you have completed the planning process, you need to set up systems on your site to perform the functions that are described in Setting Up Mail Services (Task Map). For other task information, refer to Mail Services Task Map.

Local Mail Only

The simplest mail configuration, shown in Figure 25–1, is two or more workstations that are connected to one mail host. Mail is completely local. All the clients store mail on their local disks and act as mail servers. Mail addresses are parsed by using the /etc/mail/aliases files.

Figure 25–1 Local Mail Configuration

Graphic

To set up this kind of mail configuration, you need the following.

For task information on setting up your mail service, refer to Setting Up Mail Services (Tasks). If you are looking for a particular procedure that is related to setting up your mail service, refer to Setting Up Mail Services (Task Map).

Local Mail and a Remote Connection

The most common mail configuration in a small network is shown in Figure 25–2. One system includes the mail server, the mail host, and the mail gateway to the outside world. Mail is distributed by using the /etc/mail/aliases files on the mail gateway. No name service is required.

Figure 25–2 Local Mail Configuration With a UUCP Connection

Graphic

In this configuration, you can assume that the mail clients mount their mail files from /var/mail on the mail host. To set up this kind of mail configuration, you need the following.

For task information on setting up your mail service, refer to Setting Up Mail Services (Tasks). If you are looking for a particular procedure that is related to setting up your mail service, refer to Setting Up Mail Services (Task Map).

Setting Up Mail Services (Task Map)

The following table describes the procedures for setting up mail services.

Task 

Description 

For Instructions 

Setting up a mail server 

Steps to enable a server to route mail 

How to Set Up a Mail Server

Setting up a mail client 

Steps to enable a user to receive mail 

How to Set Up a Mail Client

Setting up a mail host 

Steps to establish a mail host that can resolve email addresses 

How to Set Up a Mail Host

Setting up a mail gateway 

Steps to manage communication with networks outside your domain 

How to Set Up a Mail Gateway

Using DNS with sendmail

Steps to enable DNS host lookups 

How to Use DNS With sendmail

Setting up a virtual host 

Steps to assign more than one IP address to a host 

How to Set Up a Virtual Host

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 – 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
    

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 network to the outside world or to a parent domain. The following procedure shows you how to set up a mail host.

  1. Become superuser on the mail host 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. 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.

  4. Update the /etc/hosts file.

    Choose the step that is appropriate for you.

    1. (Optional) If you are using NIS or NIS+, edit the /etc/hosts file on the system that is assigned to be the new mail host.

      Add the word mailhost and mailhost.domain after the IP address and system name of the mail host system.


      IP_address mailhost mailhost mailhost.domain loghost

      IP_address

      Use the assigned IP address. 

      mailhost

      Use the system name of the mail host system. 

      domain

      Use the expanded domain name. 

      The system is now designated as a mail host. The domain should be identical to the string that is given as the subdomain name in the output of the following command.


      % /usr/lib/sendmail -bt -d0 </dev/null
      Version 8.12.0+Sun
       Compiled with: LDAPMAP MAP_REGEX LOG MATCHGECOS MIME7TO8 MIME8TO7
                      NAMED_BIND NDBM NETINET NETINET6 NETUNIX NEWDB NIS NISPLUS
                      QUEUE SCANF SMTP USERDB XDEBUG
      
      ============ SYSTEM IDENTITY (after readcf) ============
            (short domain name) $w = phoenix
        (canonical domain name) $j = phoenix.example.com
               (subdomain name) $m = example.com
                    (node name) $k = phoenix
      ========================================================

      See the following example of how the hosts file should look after these changes.


      # cat /etc/hosts
      #
      # Internet host table
      #
      172.31.255.255   localhost        
      192.168.255.255  phoenix mailhost mailhost.example.com loghost
    2. (Optional) If you are not using NIS or NIS+, edit the /etc/hosts file on each system in the network and create the following entry.


      IP_address mailhost mailhost mailhost.domain loghost
  5. Select the correct configuration file to copy and rename.

    The following command copies and renames the /etc/mail/main.cf file.


    # cp /etc/mail/main.cf /etc/mail/sendmail.cf
    
  6. Restart sendmail.


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

    See How to Test the Mail Configuration for instructions.

For further information about mail hosts, refer to Hardware Components in Chapter 26, Mail Services (Reference).

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).

How to Use DNS With sendmail

The DNS name service does not support aliases for individuals. This name service does support aliases for hosts or domains that use Mail Exchange (MX) records and cname records. You can specify host names, domain names, or both names in the DNS database. For more information about sendmail and DNS, see Interactions of sendmail With Name Services in Chapter 26, Mail Services (Reference), or see the System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP).

  1. Become superuser or assume an equivalent role.

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

  2. Enable DNS host lookups (NIS+ only).

    Edit the /etc/nsswitch.conf file and remove the # from the hosts definition that includes the dns flag. The host entry must include the dns flag, as the following example shows, in order for the DNS host aliases to be used.


    # grep hosts /etc/nsswitch.conf
    #hosts:     nisplus [NOTFOUND=return] files
    hosts:      nisplus dns [NOTFOUND=return] files
  3. Check for a mailhost and mailhost.domain entry.

    Use nslookup to ensure that an entry exists for mailhost and mailhost.domain in the DNS database. For more information, refer to the nslookup(1M) man page.

How to Set Up a Virtual Host

If you need to assign more than one IP address to a host, see this Web site: http://www.sendmail.org/virtual-hosting.html. This site provides complete instructions on how to use sendmail to set up a virtual host. However, in the “Sendmail Configuration” section, do not perform step 3b, as shown in the following.


# cd sendmail-VERSION/cf/cf
# ./Build mailserver.cf
# cp mailserver.cf /etc/mail/sendmail.cf

Instead, for the Solaris operating environment, perform the following steps.


# cd /usr/lib/mail/cf
# /usr/ccs/bin/make mailserver.cf
# cp mailserver.cf /etc/mail/sendmail.cf

mailserver

Use the name of the .cf file.

Building the sendmail.cf Configuration File (Task) outlines these same three steps as part of the build process.

After you have generated your /etc/mail/sendmail.cf file, you can continue with the next steps to create a virtual user table, and so forth.

Building the sendmail.cf Configuration File (Task)

How to Build a New sendmail.cf File shows you how to build the configuration file. Although you can still use older versions of sendmail.cf files, the best practice is to use the new format.

For more details, you should read from the following resources.

The following sections in Chapter 27, What's New With Mail Services (Reference) identify new m4 configuration features.

How to Build a New sendmail.cf File

The following procedure shows you how to build a new configuration file.


Note –

/usr/lib/mail/cf/main-v7sun.mc is now /usr/lib/mail/cf/main.mc.


  1. Become superuser 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. Make a copy of the configuration files that you are changing.


    # cd /usr/lib/mail/cf
    # cp main.mc myhost.mc
    

    myhost

    Select a new name for your .mc file.

  4. Edit the new configuration files (for example, myhost.mc), as necessary.

    For example, add the following command line to enable domain masquerading.


    # cat myhost.mc
    ..
    MASQUERADE_AS(`host.domain')

    host.domain

    Use the desired host name and domain name. 

    In this example, MASQUERADE_AS causes mail that is sent to be labeled as originating from host.domain, rather than $j.

  5. Build the configuration file by using m4.


    # /usr/ccs/bin/make myhost.cf
    
  6. Test the new configuration file by using the -C option to specify the new file.


    # /usr/lib/sendmail -C myhost.cf -v testaddr </dev/null
    

    This command sends a message to testaddr while displaying messages as it runs. Only outgoing mail can be tested without restarting the sendmail service on the system. For systems that are not handling mail yet, use the full testing procedure in How to Test the Mail Configuration.

  7. Install the new configuration file after making a copy of the original.


    # cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.save
    # cp myhost.cf /etc/mail/sendmail.cf
    
  8. Restart the sendmail service.


    # /etc/init.d/sendmail start
    

Managing Mail Delivery by Using an Alternate Configuration (Task)

To facilitate the transport of inbound and outbound mail, the new default configuration of sendmail uses a daemon and a client queue runner. If you have disabled your daemon, you should perform the following task. For a detailed explanation, refer to New Configuration File, submit.cf.

How to Manage Mail Delivery by Using an Alternate Configuration of sendmail.cf

In the default configuration of sendmail, the client queue runner must be able to submit mail to the daemon on the local SMTP port. If the daemon is not listening on the SMTP port, the mail remains in the queue. To avoid this problem, perform the following task. For more information about the daemon and client queue runner and to understand why you might have to use this alternate configuration, refer to New Configuration File, submit.cf.

This procedure ensures that your daemon runs only to accept connections from the local host.

  1. Become superuser 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. Make a copy of the configuration file (either subsidiary.mc or main.mc, depending on your requirements) that you are changing. In this example, the subsidiary.mc file is used.


    # cd /usr/lib/mail/cf
    # cp subsidiary.mc myhost.mc
    

    myhost

    Select a new name for your .mc file.

  4. Edit the new configuration file (for example, myhost.mc).

    Add the following lines before the MAILER() lines.


    # cat myhost.mc
    ..
    DAEMON_OPTIONS(`NAME=NoMTA4, Family=inet, Addr=127.0.0.1')dnl
    DAEMON_OPTIONS(`NAME=NoMTA6, Family=inet6, Addr=::1')dnl
    
  5. Build the configuration file by using m4.


    # /usr/ccs/bin/make myhost.cf
    
  6. Install the new configuration file after making a copy of the original.


    # cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.save
    # cp myhost.cf /etc/mail/sendmail.cf
    
  7. Restart the sendmail service.


    # /etc/init.d/sendmail start
    

Administering Mail Alias Files (Task Map)

The following table describes the procedures for administering mail alias files. For more information on this topic, refer to Mail Alias Files in Chapter 26, Mail Services (Reference).

Task 

Description 

For Instructions 

Managing alias entries in an NIS+ mail_aliases table

If your name service is NIS+, use these procedures to manage the contents of your mail_aliases table. Learn how to list, add, edit, and delete entries.

How to Manage Alias Entries in an NIS+ mail_aliases Table

Setting up an NIS mail.aliases map

If your name service is NIS, follow these instructions to facilitate aliasing with a mail.aliases map.

How to Set Up an NIS mail.aliases Map

Setting up a local mail alias file 

If you are not using a name service (such as NIS or NIS+), follow these instructions to facilitate aliasing with the /etc/mail/aliases file.

How to Set Up a Local Mail Alias File

Creating a keyed map file 

Use these steps to facilitate aliasing with a keyed map file. 

How to Create a Keyed Map File

Setting up the postmaster alias

Use the procedures in this section to manage the postmaster alias. You must have this alias.

Managing the postmaster Alias

Administering Mail Alias Files (Tasks)

Mail aliases must be unique within the domain. This section provides the procedures for administering mail alias files. Alternately, you can use the AdminTool's Database Manager application to perform these tasks on the aliases database.

In addition, you can create database files for the local mail host by using makemap. Refer to the makemap(1M) man page. The use of these database files does not provide all of the advantages of using a name service such as NIS or NIS+. However, you should be able to retrieve the data from these local database files faster because no network lookups are involved. For more information, refer to Interactions of sendmail With Name Services and Mail Alias Files in Chapter 26, Mail Services (Reference).

How to Manage Alias Entries in an NIS+ mail_aliases Table

To manage entries in an NIS+ table, you can use the aliasadm command. To list, add, modify, or delete table entries with the aliasadm command, you begin a particular task with the following steps.

  1. Either be a member of the NIS+ group that owns the table, or become root 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. Complete your task by following the instructions from the example that meets your requirements.

In some instances, you should begin the task by compiling a list of each of your mail clients, the locations of their mailboxes, and the names of the mail server systems.

Example—Initiating an NIS+ mail_aliases Table

To create a table, follow these instructions.

  1. Either be a member of the NIS+ group that owns the table, or become root 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. Initiate an NIS+ table.


    # aliasadm -I
    
  3. Add entries to the table.

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

Example—Listing the Entire Contents of the NIS+ mail_aliases Table

To see a complete list of the contents of the table, follow these instructions.

  1. Either be a member of the NIS+ group that owns the table, or become root 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. List all of the entries in alphabetical order by alias.


    # aliasadm -1
    

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

Example—Listing an Individual Entry From the NIS+ mail_aliases Table

To see an individual entry from the table, follow these instructions.

  1. Either be a member of the NIS+ group that owns the table, or become root 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. List an individual entry.


    # aliasadm -m ignatz
    ignatz: ignatz@saturn # Alias for Iggy Ignatz

    The command matches only the complete alias name, not partial strings. You cannot use metacharacters (such as * and ?) with aliasadm -m.

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

Example—Listing Partial Matches From the NIS+ mail_aliases Table

To see partial matches from the table, follow these instructions.

  1. Either be a member of the NIS+ group that owns the table, or become root 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. List partial matches from the table.


    # aliasadm -l | grep partial_string
    

    partial_string

    Use the string of your choice for your search. 

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

Example—Adding Aliases to the NIS+ mail_aliases Table From the Command Line

To add two or three aliases to the table, follow these instructions.

  1. Compile a list of each of your mail clients, the locations of their mailboxes, and the names of the mail server systems.

  2. Either be a member of the NIS+ group that owns the table, or become root on the mail server, or assume an equivalent role.

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

  3. (Optional) If necessary, initiate an NIS+ table.

    If you are creating a completely new NIS+ mail_aliases table, you must first initiate the table. To complete this task, refer to Example—Initiating an NIS+ mail_aliases Table.

  4. Add aliases to the table.

    See this example of a typical entry.


    # aliasadm -a iggy iggy.ignatz@saturn "Iggy Ignatz"
    

    The following list describes the input from the preceding example.

    -a

    The option for adding an alias 

    iggy

    The short form of the alias name 

    iggy.ignatz@saturn

    The expanded alias name 

    "Iggy Ignatz"

    The name for the alias in quotation marks 

  5. Display the entry you created and ensure that it is correct.


    # aliasadm -m alias
    

    alias

    The entry that you created 

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

Example—Adding Entries by Editing an NIS+ mail_aliases Table

To add more than two or three aliases to the table, follow these instructions.

  1. Compile a list of each of your mail clients, the locations of their mailboxes, and the names of the mail server systems.

  2. Either be a member of the NIS+ group that owns the table, or become root on the mail server, or assume an equivalent role.

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

  3. Display and edit the aliases table.


    # aliasadm -e
    

    This command displays the table and enables you to edit it. The editor you use has been set with the $EDITOR environment variable. If this variable is not set, vi is the default editor.

  4. Use the following format to type each alias on a separate line.


    alias: expanded_alias # ["option" # "comments"]

    alias

    This column is for the short form of the alias name. 

    expanded_alias

    This column is for the expanded alias name. 

    option

    This column is reserved for future use. 

    comments

    This column is used for comments about the individual alias, such as a name for the alias. 

    If you leave the option column blank, type an empty pair of quotation marks ("") and add the comments.

    The order of the entries is not important to the NIS+ mail_aliases table. The aliasadm -l command sorts the list and displays the entries in alphabetical order.

    For more information, refer to Mail Alias Files and the aliasadm(1M) man page.

Example—Editing Entries in an NIS+ mail_aliases Table

To edit entries in the table, follow these instructions.

  1. Either be a member of the NIS+ group that owns the table, or become root 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. Display the alias entry.


    # aliasadm -m alias
    

    alias

    Use the assigned alias name. 

  3. Edit the alias entry, as necessary.


    # aliasadm -c alias expanded_alias [options comments]
    

    alias

    If necessary, edit the alias name. 

    expanded_alias

    If necessary, edit the expanded alias name. 

    options

    If necessary, edit the option. 

    comments

    If necessary, edit the comment for this entry. 

    For more information, refer to the aliasadm(1M) man page, as well as Mail Alias Files.

  4. Display the entry that you have edited and ensure that the entry is correct.


    # aliasadm -m alias
    

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

Example—Deleting Entries From an NIS+ mail_aliases Table

To delete entries from the table, follow these instructions.

  1. Either be a member of the NIS+ group that owns the table, or become root 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. Delete an entry from the table.


    # aliasadm -d alias
    

    alias

    Use the alias name for the entry that you are deleting. 

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

How to Set Up an NIS mail.aliases Map

Use the following procedure to facilitate aliasing with an NIS mail.aliases map.

  1. Compile a list of each of your mail clients, the locations of their mailboxes, and the names of the mail server systems.

  2. Become root on the NIS master server or assume an equivalent role.

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

  3. Edit the /etc/mail/aliases file, and make the following entries.

    1. Add an entry for each mail client.


      # cat /etc/mail/aliases
      ..
      alias:expanded_alias
      

      alias

      Use the short alias name. 

      expanded_alias

      Use the expanded alias name (user@host.domain.com).

    2. Ensure that you have a Postmaster: root entry.


      # cat /etc/mail/aliases
      ..
      Postmaster: root
      
    3. Add an alias for root. Use the mail address of the person who is designated as the postmaster.


      # cat /etc/mail/aliases
      ..
      root: user@host.domain.com
      

      user@host.domain.com

      Use the assigned address of the designated postmaster. 

  4. Ensure that the NIS master server is running a name service to resolve the host names on each mail server.

  5. Change to the /var/yp directory.


    # cd /var/yp
    
  6. Apply the make command.


    # make
    

    The changes in the /etc/hosts and /etc/mail/aliases files are propagated to NIS slave systems and are active in only a few minutes, at most.

How to Set Up a Local Mail Alias File

Use the following procedure to resolve aliases with a local mail alias file.

  1. Compile a list of each of your users and the locations of their mailboxes.

  2. Become root on the mail server or assume an equivalent role.

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

  3. Edit the /etc/mail/aliases file and make the following entries.

    1. Add an entry for each user.


      user1: user2@host.domain
      

      user1

      Use the new alias name. 

      user2@host.domain

      Use the actual address for the new alias. 

    2. Ensure that you have a Postmaster: root entry.


      # cat /etc/mail/aliases
      ..
      Postmaster: root
      
    3. Add an alias for root. Use the mail address of the person who is designated as the postmaster.


      # cat /etc/mail/aliases
      ..
      root: user@host.domain.com
      

      user@host.domain.com

      Use the assigned address of the designated postmaster. 

  4. Rebuild the alias database.


    # newaliases
    

    Depending on the configuration of the AliasFile option in /etc/mail/sendmail.cf, this command generates in binary form either the single file, /etc/mail/aliases.db, or the pair of files, /etc/mail/aliases.dir and /etc/mail/aliases.pag.

  5. Perform one of the following steps to copy the file or files that were generated.

    1. (Optional) Copy the /etc/mail/aliases, the /etc/mail/aliases.dir, and the/etc/mail/aliases.pag files to each of the other systems.

      You can copy the three files by using the rcp or rdist commands. Refer to the rcp(1) man page or the rdist(1) man page for more information. Alternately, you can create a script for this purpose.

      When you copy these files, you do not need to run the newaliases command on each of the other systems. However, remember that you must update all the /etc/mail/aliases files each time you add or remove a mail client.

    2. (Optional) Copy the /etc/mail/aliases.db file to each of the other systems.

      You can copy the file by using the rcp or rdist commands. Refer to the rcp(1) man page or the rdist(1) man page for more information. Alternately, you can create a script for this purpose.

      When you copy this file, you do not need to run the newaliases command on each of the other systems. However, remember that you must update all the /etc/mail/aliases files each time you add or remove a mail client.

How to Create a Keyed Map File

To create a keyed map file, follow these instructions.

  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. Create an input file.

    Entries can have the following syntax.


    old_name@newdomain.com   new_name@newdomain.com
    old_name@olddomain.com    error:nouser No such user here
    @olddomain.com          %1@newdomain.com
    

    old_name@newdomain.com

    Use the user name that was previously assigned with the domain that is newly assigned. 

    new_name@newdomain.com

    Use the address that is newly assigned. 

    old_name@olddomain.com

    Use the user name that was previously assigned with the domain that was previously assigned. 

    olddomain.com

    Use the domain that was previously assigned. 

    newdomain.com

    Use the domain that is newly assigned. 

    The first entry redirects mail to a new alias. The next entry creates a message when an incorrect alias is used. The last entry redirects all incoming mail from olddomain to newdomain.

  3. Create the database file.


    # /usr/sbin/makemap maptype newmap < newmap
    

    maptype

    Select a database type, such as dbm, btree, or hash.

    newmap

    Use the name of the input file and the first part of the name of the database file. If the dbm database type is selected, then the database files are created by using a .pag and a .dir suffix. For the other two database types, the file name is followed by .db.

Managing the postmaster Alias

Every system must be able to send mail to a postmaster mailbox. You can create an NIS or NIS+ alias for postmaster, or you can create the alias in each local /etc/mail/aliases file. Refer to these procedures.

How to Create a postmaster Alias in Each Local /etc/mail/aliases File

If you are creating the postmaster alias in each local /etc/mail/aliases file, follow these instructions.

  1. Become superuser on each local system or assume an equivalent role.

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

  2. View the /etc/mail/aliases entry.


    # cat /etc/mail/aliases
    # Following alias is required by the mail protocol, RFC 2821
    # Set it to the address of a HUMAN who deals with this system's
    # mail problems.
    Postmaster: root
  3. Edit each system's /etc/mail/aliases file.

    Change root to the mail address of the person who is designated as the postmaster.


    Postmaster: mail_address
    

    mail_address

    Use the assigned address for the person who is designated as the postmaster. 

  4. (Optional) Create a separate mailbox for the postmaster.

    You can create a separate mailbox for the postmaster to keep postmaster mail separate from personal mail. If you create a separate mailbox, use the mailbox address instead of the postmaster's personal mail address when you edit the /etc/mail/aliases files. For details, refer to How to Create a Separate Mailbox for postmaster.

How to Create a Separate Mailbox for postmaster

If you are creating a separate mailbox for postmaster, follow these instructions.

  1. Become root 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. Create a user account for the person who is designated as postmaster and put an asterisk (*) in the password field.

    For details about adding a user account, refer to “Managing User Accounts and Groups (Tasks)” in System Administration Guide: Basic Administration.

  3. After mail has been delivered, enable the mail program to read and write to the mailbox name.


    # mail -f postmaster
    

    postmaster

    Use the assigned address. 

How to Add the postmaster Mailbox to the Aliases in the /etc/mail/aliases File

If you are adding a postmaster mailbox to the aliases in the /etc/mail/aliases file, follow these instructions.

  1. Become root on each system or assume an equivalent role.

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

  2. Add an alias for root. Use the mail address of the person who is designated as the postmaster.


    # cat /etc/mail/aliases
    ..
    root: user@host.domain.com
    

    user@host.domain.com

    Use the assigned address of the person who is designated as postmaster. 

  3. On the postmaster's local system, create an entry in the /etc/mail/aliases file that defines the name of the alias (sysadmin, for example) and include the path to the local mailbox.


    # cat /etc/mail/aliases
    ..
    sysadmin: /usr/somewhere/somefile
    

    sysadmin

    Create a name for a new alias. 

    /usr/somewhere/somefile

    Use the path to the local mailbox. 

  4. Rebuild the alias database.


    # newaliases
    

Administering the Queue Directories (Task Map)

The following table describes the procedures for administering the mail queue.

Task 

Description 

For Instructions 

Displaying the contents of the mail queue, /var/spool/mqueue

Use this procedure to see how many messages are in the queue and how fast the messages are being cleared from the queue. 

How to Display the Contents of the Mail Queue, /var/spool/mqueue

Forcing mail queue processing for the mail queue, /var/spool/mqueue

Use this procedure to process messages to a system that previously was unable to receive messages. 

How to Force Mail Queue Processing in the Mail Queue, /var/spool/mqueue

Running a subset of the mail queue, /var/spool/mqueue

Use this procedure to force a substring of an address, such as a host name, to be processed or to force a particular message out of the queue. 

How to Run a Subset of the Mail Queue, /var/spool/mqueue

Moving the mail queue, /var/spool/mqueue

Use this procedure to move the mail queue. 

How to Move the Mail Queue, /var/spool/mqueue

Running the old mail queue, /var/spool/omqueue

Use this procedure to run an old mail queue. 

How to Run the Old Mail Queue, /var/spool/omqueue

Administering the Queue Directories (Tasks)

This section describes some helpful tasks for queue administration. For information about the client-only queue, refer to New Configuration File, submit.cf. For other related information, you can refer to New Queue Features.

How to Display the Contents of the Mail Queue, /var/spool/mqueue

Use this procedure to see how many messages are in the queue and how fast they are being cleared from the queue.

Use the following command to display this information.


# /usr/bin/mailq | more

This command now checks for the authorization attribute, solaris.admin.mail.mailq. If the check is successful, the equivalent of specifying the -bp flag with sendmail is executed. If the check fails, an error message is printed. By default, this authorization attribute is enabled for all users. The authorization attribute can be disabled by modifying the user entry in prof_attr. For more information, refer to the man pages for prof_attr(4) and mailq(1).

How to Force Mail Queue Processing in the Mail Queue, /var/spool/mqueue

Use this procedure, for example, to process messages to a system that was previously unable to receive messages.

  1. Become root or assume an equivalent role.

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

  2. Force queue processing and display the progress of the jobs as the queue is cleared.


    # /usr/lib/sendmail -q -v 
    

How to Run a Subset of the Mail Queue, /var/spool/mqueue

Use this procedure, for example, to force a substring of an address, such as a host name, to be processed or to force a particular message from the queue.

  1. Become root or assume an equivalent role.

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

  2. Run a subset of the mail queue at any time with -qRstring.


    # /usr/lib/sendmail -qRstring
    

    string

    Use a recipient's alias or a substring (like a host name) of user@host.domain.

    Alternately, you can run a subset of the mail queue with -qInnnnn.


    # /usr/lib/sendmail -qInnnnn
    

    nnnnn

    Use a queue ID. 

How to Move the Mail Queue, /var/spool/mqueue

If you are moving the mail queue, follow these instructions.

  1. Become root on the mail host or assume an equivalent role.

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

  2. Kill the sendmail daemon.


    # /etc/init.d/sendmail stop
    

    Now sendmail is no longer processing the queue directory.

  3. Change to the /var/spool directory.


    # cd /var/spool
    
  4. Move the directory, mqueue, and all its contents to the omqueue directory. Then create a new empty directory that is named mqueue.


    # mv mqueue omqueue; mkdir mqueue
    
  5. Set the permissions of the directory to read/write/execute by owner, and read/execute by group. Also, set the owner and group to daemon.


    # chmod 750 mqueue; chown root:bin mqueue
    
  6. Start sendmail.


    # /etc/init.d/sendmail start
    

How to Run the Old Mail Queue, /var/spool/omqueue

To run an old mail queue, follow these instructions.

  1. Become root or assume an equivalent role.

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

  2. Run the old mail queue.


    # /usr/lib/sendmail -oQ/var/spool/omqueue -q
    

    The -oQ flag specifies an alternate queue directory and the -q flag says to run every job in the queue. Use the -v flag if you are displaying the verbose output on the screen.

  3. Remove the empty directory.


    # rmdir /var/spool/omqueue
    

Administering .forward Files (Task Map)

The following table describes the procedures for administering .forward files. For more information, refer to .forward Files in Chapter 26, Mail Services (Reference).

Task 

Description 

For Instructions 

Disabling .forward files

Use this procedure if, for example, you want to prevent automated forwarding. 

How to Disable .forward Files

Changing the .forward file search path

Use this procedure if, for example, you want to move all .forward files into a common directory.

How to Change the .forward File Search Path

Creating and populating /etc/shells

Use this procedure to enable users to use the .forward file to forward mail to a program or to a file.

How to Create and Populate /etc/shells

Administering .forward Files (Tasks)

This section contains several procedures that are related to .forward file administration. Because these files can be edited by users, they can cause problems. For more information, refer to .forward Files in Chapter 26, Mail Services (Reference).

How to Disable .forward Files

This procedure, which prevents automated forwarding, disables the .forward file for a particular host.

  1. Become root or assume an equivalent role.

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

  2. Make a copy of /usr/lib/mail/domain/solaris-generic.m4 or your site-specific domain m4 file.


    # cd /usr/lib/mail/domain
    # cp solaris-generic.m4 mydomain.m4
    

    mydomain

    Use the file name of your choice. 

  3. Add the following line to the file you just created.


    define(`confFORWARD_PATH',`')dnl
    

    If a value for confFORWARD_PATH already exists in the m4 file, replace it with this null value.

  4. Build and install a new configuration file.

    If you need help with this step, refer to How to Build a New sendmail.cf File.

How to Change the .forward File Search Path

If, for example, you want to put all .forward files in a common directory, follow these instructions.

  1. Become root or assume an equivalent role.

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

  2. Make a copy of /usr/lib/mail/domain/solaris-generic.m4 or your site-specific domain m4 file.


    # cd /usr/lib/mail/domain
    # cp solaris-generic.m4 mydomain.m4
    

    mydomain

    Use the file name of your choice. 

  3. Add the following line to the file that you just created.


    define(`confFORWARD_PATH',`$z/.forward:/var/forward/$u')dnl

    If a value for confFORWARD_PATH already exists in the m4 file, replace it with this new value.

  4. Build and install a new configuration file.

    If you need help with this step, refer to How to Build a New sendmail.cf File.

How to Create and Populate /etc/shells

This file is not included in the standard release, so you must add it if users are to be allowed to use .forward files to forward mail to a program or to a file. You can create the file manually by using grep to identify all of the shells that are listed in your password file. You can then type the shells into the file. However, it is easier to use the following procedure, which employs a script that can be downloaded.

  1. Download the script.

    http://www.sendmail.org/vendor/sun/gen-etc-shells.html

  2. Become root or assume an equivalent role.

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

  3. To generate a list of shells, run the gen-etc-shells script.


    # ./gen-etc-shells.sh > /tmp/shells
    

    This script uses the getent command to collect the names of shells that are included in the password file sources that are listed in /etc/nsswitch.conf.

  4. Inspect and edit the list of shells in /tmp/shells.

    With the editor of your choice, remove any shells that you are not including.

  5. Move the file to /etc/shells.


    # mv /tmp/shells /etc/shells
    

Troubleshooting Procedures and Tips for Mail Services (Task Map)

The following table describes troubleshooting procedures and tips for mail services.

Task 

Description 

For Instructions 

Testing mail configuration 

Steps for testing changes to the sendmail configuration file

How to Test the Mail Configuration

Checking mail aliases 

A step to confirm that mail can or cannot be delivered to a specified recipient 

How to Check Mail Aliases

Testing the rule sets 

Steps for checking the input and returns of the sendmail rule sets

How to Test the sendmail Rule Sets

Verifying connections to other systems 

Tips for verifying connections to other systems 

How to Verify Connections to Other Systems

Logging messages by using the syslogd program

Tips for gathering error message information 

Logging Error Messages

Checking other sources for diagnostic information 

Tips for getting diagnostic information from other sources 

Other Sources for Mail Diagnostic Information

Troubleshooting Procedures and Tips for Mail Services (Tasks)

This section provides some procedures and tips that you can use for troubleshooting problems with mail services.

How to Test the Mail Configuration

To test the changes you make to your configuration file, follow these instructions.

  1. Restart sendmail on any system that has a revised configuration file.


    # pkill -HUP sendmail
    
  2. Send test messages from each system.


    # /usr/lib/sendmail -v names </dev/null
    

    names

    Specify a recipient's email address. 

    This command sends a null message to the specified recipient and displays the message activity on your monitor.

  3. Send mail to yourself or other people on the local system by addressing the message to a regular user name.

  4. (Optional) If you are connected to a network, send mail in three directions to someone on another system.

    • From the main system to a client system

    • From a client system to the main system

    • From a client system to another client system

  5. (Optional) If you have a mail gateway, send mail to another domain from the mail host to ensure that the relay mailer and host are configured properly.

  6. (Optional) If you have set up a UUCP connection on your phone line to another host, send mail to someone at that host and have that person send mail back or call you when the message is received.

  7. Ask someone to send mail to you over the UUCP connection.

    The sendmail program cannot detect whether the message is delivered because it passes the message to UUCP for delivery.

  8. From different systems, send a message to postmaster and ensure that it is delivered to your postmaster's mailbox.

How to Check Mail Aliases

To verify aliases and to confirm that mail can or cannot be delivered to a specified recipient, follow these instructions.

Display the aliases and identify that the final address is deliverable or not deliverable.


% /usr/lib/sendmail -v -bv recipient

recipient

Specify a recipient's alias. 

The following is an example of the output.


% /usr/lib/sendmail -v -bv sandy
sandy... aliased to ssmith
ssmith... aliased to sandy@phoenix
sandy@phoenix... deliverable: mailer esmtp, host phoenix, user sandy@phoenix.example.com
%

Avoid loops and inconsistent databases when both local and domain-wide aliases are used. Be especially careful when you move a user from one system to another to avoid the creation of alias loops.

How to Test the sendmail Rule Sets

To check the input and returns of the sendmail rule sets, follow these instructions.

  1. Change to address test mode.


    # /usr/lib/sendmail -bt
    
  2. Test a mail address.

    Provide the following numbers and address at the last prompt (>).


    > 3,0 mail_address
    

    mail_address

    Use the mail address that you are testing. 

  3. End the session.

    Press Control-d.

The following is an example of the output.


% /usr/lib/sendmail -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> 3,0 sandy@phoenix
canonify           input: sandy @ phoenix
Canonify2          input: sandy < @ phoenix >
Canonify2        returns: sandy < @ phoenix . example . com . >
canonify         returns: sandy < @ phoenix . example . com . >
parse              input: sandy < @ phoenix . example . com . >
Parse0             input: sandy < @ phoenix . example . com . >
Parse0           returns: sandy < @ phoenix . example . com . >
ParseLocal         input: sandy < @ phoenix . example . com . >
ParseLocal       returns: sandy < @ phoenix . example . com . >
Parse1             input: sandy < @ phoenix . example . com . >
MailerToTriple     input: < mailhost . phoenix . example . com > 
     sandy < @ phoenix . example . com . >
MailerToTriple   returns: $# relay $@ mailhost . phoenix . example . com 
     $: sandy < @ phoenix . example . com . >
Parse1           returns: $# relay $@ mailhost . phoenix . example . com 
     $: sandy < @ phoenix . example . com . >
parse            returns: $# relay $@ mailhost . phoenix . example . com 
     $: sandy < @ phoenix . example . com . >

How to Verify Connections to Other Systems

The mconnect program opens a connection to a mail server on a host that you specify and enables you to test that connection. The program runs interactively, so you can issue various diagnostic commands. See the mconnect(1) man page for a complete description. The following example verifies that mail to the user name sandy is deliverable.


% mconnect phoenix

connecting to host phoenix (172.31.255.255), port 25
connection open
220 phoenix.example.com ESMTP Sendmail 8.12.0+Sun/8.12.0; Sun, 4 Sep 2001 3:52:56 -0700(PDT)
expn sandy
250 2.1.5 <sandy@phoenix.example.com>
quit

If you cannot use mconnect to connect to an SMTP port, check these conditions.

Logging Error Messages

Your mail services logs most error messages by using the syslogd program. By default, the syslogd program sends these messages to a system that is called loghost, which is specified in the /etc/hosts file. You can define loghost to hold all logs for an entire NIS domain. If no loghost is specified, error messages from syslogd are not reported.

The /etc/syslog.conf file controls where the syslogd program forwards messages. You can change the default configuration by editing the /etc/syslog.conf file. You must restart the syslog daemon for any changes to become active. To gather information about mail, you can add the following selections to the file.

The following entry in the /etc/syslog.conf file sends a copy of all critical, informational, and debug messages to /var/log/syslog.


mail.crit;mail.info;mail.debug			/var/log/syslog

Each line in the system log contains a timestamp, the name of the system that generated the line, and a message. The syslog file can log a large amount of information.

The log is arranged in a succession of levels. At the lowest level, only unusual occurrences are logged. At the highest level, even the most mundane and uninteresting events are recorded. As a convention, log levels under 10 are considered “useful.” Log levels higher than 10 are usually used for debugging. See the “Customizing System Message Logging” in System Administration Guide: Advanced Administration for information about loghost and the syslogd program.

Other Sources for Mail Diagnostic Information

For other diagnostic information, check the following sources.

Resolving Error Messages

This section describes how you can resolve some sendmail–related error messages that are in the Solaris 9 operating environment. You can also refer to http://www.sendmail.org/faq/.

The following error messages contain two or more of the following types of information.


451 timeout waiting for input during source

Cause: When sendmail reads from any source that might time out, such as an SMTP connection, it sets a timer to the value of various Timeout options before reading begins. If the read is not completed before the timer expires, this message appears and reading stops. (Usually this situation occurs during RCPT.) The mail message is then queued for later delivery.

Action: If you see this message often, increase the value of various Timeout options in the /etc/mail/sendmail.cf file. If the timer is already set to a large number, look for hardware problems, such as poor network cabling or connections.

See Also: For more information about the Timeout option, refer to Changes to the Timeout Option. If you are using online documentation, the term “timeouts” is a good search string.


550 hostname... Host unknown

Cause: This sendmail message indicates that the destination host machine, which is specified by the portion of the address after the at sign (@), was not found during domain name system (DNS) lookup.

Action: Use the nslookup command to verify that the destination host exists in that domain or other domains, perhaps with a slightly different spelling. Otherwise, contact the intended recipient and ask for a proper address.


550 username... User unknown

Cause: This sendmail message indicates that the intended recipient, who is specified by the portion of the address before the at sign (@), could not be located on the destination host machine.

Action: Check the email address and try again, perhaps with a slightly different spelling. If this remedy does not work, contact the intended recipient and ask for a proper address.


554 hostname... Local configuration error

Cause: This sendmail message usually indicates that the local host is trying to send mail to itself.

Action: Check the value of the $j macro in the /etc/mail/sendmail.cf file to ensure that this value is a fully qualified domain name.

Technical Notes: When the sending system provides its host name to the receiving system (in the SMTP HELO command), the receiving system compares its name to the sender's name. If these names are the same, the receiving system issues this error message and closes the connection. The name that is provided in the HELO command is the value of the $j macro.

See Also: For additional information, refer to http://www.sendmail.org/faq/section4.html#4.5.


config error: mail loops back to myself.

Cause: If you set up an MX record and make host bar the mail exchanger for domain foo, but you do not configure host bar to know that it is the mail exchanger for domain foo, you receive this error message.

Also, another possibility is that both the sending system and the receiving system are identifying as the same domain.

Action: For instructions, refer to http://www.sendmail.org/faq/section4.html#4.5.


host name configuration error

Action: Follow the instructions that were provided for resolving this error message, 554 hostname... Local configuration error.

Technical Notes: This is an old sendmail message, which replaced I refuse to talk to myself and is now replaced by the Local configuration error message.


user unknown

Description: When you try to send mail to a user, the error Username... user unknown is displayed. The user is on the same system.

Action: Check for a typographical error in the entered email address. Otherwise, the user could be aliased to a nonexistent email address in /etc/mail/aliases or in the user's .mailrc file. Also, check for uppercase characters in the user name. Preferably, email addresses should not be case sensitive.

See Also: For additional information, refer to http://www.sendmail.org/faq/section4.html#4.17.