Previous Table of Contents Next


Message Delivery

For each unique mailer and host in the recipient list, sendmail calls the appropriate mailer. Each invocation of a mailer sends a message to all of the users on one host. Mailers that accept only one recipient at a time are handled properly.

The sendmail program sends the message to the mailer using one of the same interfaces used to submit a message to sendmail (using the conventional UNIX argument vector/return status, speaking over a pair of UNIX pipes, and speaking SMTP over a TCP connection). Each copy of the message has a customized header attached to the beginning of it. The mailer catches and checks the status code, and a suitable error message is given as appropriate. The exit code must conform to a system standard. If a nonstandard exit code is used, the message Services unavailable is used.

Queuing for Retransmission

When the mailer returns a status that shows it might be able to handle the mail later (for example, the next host is down, or the phone is busy for uucp), sendmail stores it in a queue and tries again later.

Return to Sender

If errors occur during processing, sendmail returns the message to the sender for retransmission. The letter may be mailed back or written to the dead.letter file in the sender's home directory.

How Mail Addressing Works

Assuming that you use the default rule set in the sendmail.cf file, the following examples show the routes an email message may take. The route is determined by how the email is addressed.

  Mail within a domain addressed with only the user's login name goes to the aliases file on the mailhost (or to the Aliases database) and is sent to the address found in the database. In the example shown in Figure 1-9, mail addressed to the user winsor goes to the mailhost and is forwarded to the host named castle.


Figure 1-9  Delivery path for mail addressed with a user-name only.

  Mail within a domain addressed with the user's login name and host name goes directly to the host system without any additional processing. In the example shown in Figure 1-10, mail addressed to the user winsor at the host named castle goes directly to the host named castle.


Figure 1-10  Delivery path for mail addressed with the username and the host name.

  Mail within a domain addressed with the user's login name and domain name goes to the aliases file on the mailhost (or to the Aliases database). If the mailhost has an alias, it redirects the message to the host system. In the example shown in Figure 1-11, mail addressed to the user winsor@Eng goes to the mailhost and is then forwarded to the host named castle.


Figure 1-11  Delivery path for mail addressed with the username and the domain name.

  Mail addressed with the user's name and a fully qualified domain name goes to the mailhost, which sends it to the relay host. The relay host sends the message to the host system. When the mail comes from the recipient's domain, however, the mailhost recognizes the domain name and does not send the message to the relay host. In the example shown in Figure 1-12, mail addressed to the user ignatz@Eng.sun.com from outside of the engineering domain goes to the sender's mailhost and then to the sender's relay host. It is then forwarded to the recipient's relay host, the recipient's mail host, and finally to the host named oak.


Figure 1-12  Delivery path for mail addressed with a username and a fully qualified domain name.


Previous Table of Contents Next