Installing and Administering Internet Services

Chapter 4 145
Installing and Administering sendmail
How sendmail Works
If sendmail tries all MX hosts in its preference list and fails to deliver a
message, the message is returned to the sender with an error message.
For more information, see “MX Records” on page 139.
If delivery failed on an alias, and an owner is configured for that alias in
the aliases database, sendmail returns the message and transcript to
the alias owner.
If there is an Errors-To: header line in the message header, sendmail
returns the message and transcript to the address on the Errors-To:
line instead of to the sender.
If the Postmaster Copy option (option P) is set to a valid address,
sendmail sends a copy of the transcript and failed message (with the
message body deleted) to the Postmaster Copy address.
If the attempt to return the failed message itself fails, sendmail returns
the message and transcript to the alias postmaster on the local system.
The postmaster alias in the default alias file
(/usr/newconfig/etc/mail/aliases) resolves to root.
If sendmail is unable to return the message to any of the addresses
described above, as a last resort it appends the error transcript and
returned message to the file /var/tmp/dead.letter.
Finally, if this fails, sendmail logs the failure and leaves the original
failed message in the mail queue so that a future queue-processing
daemon will try to send it, fail, and try again to return an error message.
How sendmail Handles “Temporary” Failures
Messages that fail temporarily are saved in the mail queue and retried
later. By default, the mail queue is stored in the directory
/var/spool/mqueue. sendmail saves the message components in two
files created in the mail queue directory. The message body is saved in a
“data” file, and the envelope information, the header lines, and the name
of the data file are saved in a “queue control” file.
Typically, the sendmail daemon is run with the -q time_interval
option, as in the following example:
/usr/sbin/sendmail -bd -q30m
In this example, every 30 minutes, sendmail processes any messages
currently in the queue.