0101-0102.html
来自「linux-unix130.linux.and.unix.ebooks130 l」· HTML 代码 · 共 215 行
HTML
215 行
<HTML>
<HEAD>
<TITLE>Developer.com - Online Reference Library - 0672311739:RED HAT LINUX 2ND EDITION:SMTP and POP</TITLE>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!-- ISBN=0672311739 //-->
<!-- TITLE=RED HAT LINUX 2ND EDITION //-->
<!-- AUTHOR=DAVID PITTS ET AL //-->
<!-- PUBLISHER=MACMILLAN //-->
<!-- IMPRINT=SAMS PUBLISHING //-->
<!-- PUBLICATION DATE=1998 //-->
<!-- CHAPTER=07 //-->
<!-- PAGES=0097-0130 //-->
<!-- UNASSIGNED1 //-->
<!-- UNASSIGNED2 //-->
<P><CENTER>
<a href="0097-0100.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0103-0105.html">Next</A>
</CENTER></P>
<A NAME="PAGENUM-101"><P>Page 101</P></A>
<P>Now, what if someone on a.whizzer.com wants to send mail to
joe@gonzo.gov? Ns.whizzer.com has no information about hosts in the
gonzo.gov domain, but it knows how to find this
information. When a nameserver receives a request for a host in a domain for which it has no
information, it asks the root nameservers for the names and IP addresses of servers authoritative
for that domain—in this case, gonzo.gov. The root nameserver gives the
ns.whizzer.com name- server the names and IP addresses of hosts running nameservers with authority for
gonzo.gov. The ns.whizzer.com nameserver inquires of them and forwards the reply back to
a.whizzer.com.
</P>
<P>From the preceding description, you can see that the DNS is a large, distributed database
containing mappings between hostnames and IP addresses, but it contains other information
as well. When a program like sendmail delivers mail, it must translate the recipient's
hostname into an IP address. This bit of DNS data is known as an
A (address) record, and it is the most fundamental data about a host. A second piece of host data is the
mail exchanger (MX) record. An MX record for a host like
a.whizzer.com lists one or more hosts that are willing to
receive mail for it.
</P>
<P>What's the point? Why shouldn't a.whizzer.com simply receive its own mail and be done
with the process? Isn't a postmaster's life complicated enough without having to worry about
mail exchangers? Well, although it's true that the postmaster's life is often overly complicated,
MX records serve useful purposes:
</P>
<UL>
<LI> Hosts not on the Internet (for example, UUCP-only hosts) can designate an
Internet host to receive their mail and so appear to have Internet addresses. For
example, suppose that a.whizzer.com is connected to
ns.whizzer.com only once a day via a UUCP link. If
ns.whizzer.com publishes an MX record for it, other Internet hosts
can still send it mail. When ns.whizzer.com receives the mail, it saves the mail
until a.whizzer.com connects. This use of MX records allows non-Internet hosts to
appear to be on the Internet (but only to receive e-mail).
<LI> Imagine a UNIX host
pcserv.whizzer.com that acts as a file server for a cluster
of personal computers. The PC clones have MUAs with built-in SMTP clients that
allow them to send mail but not receive mail. If return addresses on the outbound mail
look like someone@pc1.whizzer.com, how can people reply to the mail? MX records come
to the rescue again. pcserv.whizzer.com publishes itself as the MX host for all the
PC clones, and mail addressed to them is sent there.
<LI> Hosts can be off the Internet for extended times because of unpredictable
reasons ranging from lightning strikes to the propensity of backhoe operators to
unexpectedly unearth fiber optic cables. Although your host is off the Internet, its mail queues
on other hosts, and after a while it bounces back to the sender. If your host has MX
hosts willing to hold its mail in the interim, the mail will be delivered when your host
is available again. The hosts can be either on-site (that is, in your domain) or off-site,
or both. The last option is best because backhoe operator disasters usually take
your entire site off the Net, in which case an on-site backup does no good.
</UL>
<A NAME="PAGENUM-102"><P>Page 102</P></A>
<UL>
<LI> MX records hide
information and allow you more flexibility to reconfigure your
local network. If all your correspondents know that your e-mail address is
joe@whizzer.com, it doesn't matter whether the host that receives mail for
whizzer.com is named zippy.whizzer.com or
pinhead.whizzer.com. It also doesn't matter if you decide
to change the name to white-whale.whizzer.com; your correspondents will never
know the difference.
</UL>
<P>For the full details on configuring DNS for Linux, see Chapter 13.
</P>
<H4><A NAME="ch07_ 5">
Mail Delivery and MX Records
</A></H4>
<P>When an SMTP client delivers mail to a host, it must do more than translate the
hostname into an IP address. First, the client asks for MX records. If
any exist, it sorts them according to the priority given in the record. For example,
whizzer.com might have MX records listing the hosts
mailhub.whizzer.com, walrus.whizzer.com, and
mailer.gonzo.gov as the hosts willing to receive mail for it (and the "host"
whizzer.com might not exist except as an MX record,
meaning that no IP address might be available for it). Although any of these hosts will accept
mail for whizzer.com, the MX priorities specify which of these hosts the SMTP client should
try first, and properly behaved SMTP clients will do so. In this case, the system administrator
has set up a primary mail relay
mailhub.whizzer.com and an on-site backup
walrus.whizzer.com, and has arranged with the system administrator at
mailer.gonzo.gov for an off-site backup. The administrators have set the MX priorities so that SMTP clients will try the primary
mail relay first, the on-site backup second, and the off-site backup third. This setup takes care of
the problems with the vendor who doesn't ship your parts on time as well as the wayward
backhoe operator who severs the fiber optic cable that provides your site's Internet connection.
</P>
<P>After collecting and sorting the MX records, the SMTP client gathers the IP addresses for
the MX hosts and attempts delivery to them in order of MX preference. You should keep this
fact in mind when debugging mail problems. Just because a letter is addressed to
joe@whizzer.com doesn't necessarily mean that a host named
whizzer.com exists. Even if such a host does
exist, it might not be the host that is supposed to receive the mail.
</P>
<H4><A NAME="ch07_ 6">
Header and Envelope Addresses
</A></H4>
<P>The distinction between header and envelope addresses is important because mail routers
can process them differently. An example will help explain the difference between the two.
</P>
<P>Suppose you have a paper memo that you want to send to your colleagues Mary and Bill at
the Gonzo Corporation, and Ted and Ben at the Whizzer company. You give a copy of the
memo to your trusty mail clerk Alphonse, who notes the multiple recipients. Because he's a
clever fellow who wants to save your company 32 cents, he makes two copies of the memo and
puts each in an envelope addressed to the respective companies (instead of sending a copy to
each recipient). On the cover of the Gonzo envelope, he writes Mary and Bill, and on the cover
of the Whizzer envelope, he writes Ted and Ben. When Alphonse's counterparts at Gonzo
and Whizzer receive the envelopes, they make copies of the memo and send them to Mary,
Bill,
</P>
<P><CENTER>
<a href="0097-0100.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0103-0105.html">Next</A>
</CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?