Installing and Administering Internet Services

140 Chapter 4
Installing and Administering sendmail
How sendmail Works
temporarily down or otherwise inaccessible. For information on creating
MX records, see “Configuring and Administering the BIND Name Service”
on page 59.
MX records are used only if a message address resolves to an IPC mailer
(that is, one that uses SMTP over sockets to perform delivery.) Instead of
attempting to connect directly to the recipient host, sendmail first
queries the name server, if it is running, for MX records for that host. If
the name server returns any, sendmail sorts them in preference order,
highest preference (lowest number) first. If the local host appears in the
list, it and any MX hosts with lower preference (higher numbers) are
removed from the list. If any MX hosts remain, sendmail then tries to
connect to each MX host in the list in order, and it delivers the message to
the first MX host to which it successfully connects. If that MX host is not
the final destination for the message, it is expected that the host will
relay the message to its final destination.
If sendmail tries all the MX hosts in the list and fails, the message is
returned to the sender with an error message. If you want sendmail to
try to connect to the host to which the message is addressed, uncomment
the following line in the /etc/mail/sendmail.cf file:
TryNullMXList
sendmail then tries to connect to the host to which the message is
addressed, if any of the following conditions occur:
The name server returns no MX records.
The name server is not running.
The local host is the highest preference mail exchanger in the list.
At log level 11 and above, sendmail logs in the system log the name and
internet address of the MX host (if any) to which it delivered (or
attempted to deliver) a message.
MX records are used for two main purposes:
To arrange that one host “back up” another by receiving mail for it
when it is down.
To arrange that mail addressed to remote networks be relayed
through the appropriate gateways.
In the following example, the name server serving the domain paf.edu
has the following MX records configured to provide backup for host
bling: