?? 701-704.html
字號:
<HTML>
<HEAD>
<TITLE>Linux Unleashed, Third Edition:Configuring Linux for Mail</TITLE>
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!--ISBN=0672313723//-->
<!--TITLE=Linux Unleashed, Third Edition//-->
<!--AUTHOR=Tim Parker//-->
<!--PUBLISHER=Macmillan Computer Publishing//-->
<!--IMPRINT=Sams//-->
<!--CHAPTER=40//-->
<!--PAGES=701-704//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="../ch39/696-700.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="704-706.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H2><A NAME="Heading1"></A><FONT COLOR="#000077">Chapter 40<BR>Configuring Linux for Mail
</FONT></H2>
<P><I>by Tim Parker</I></P>
<DL>
<DT><B>In This Chapter</B>
<DT>• How email works
<DT>• Configuring sendmail
<DT>• Using sendmail version 8
<DT>• smail
<DT>• Modifying behavior of smail
</DL>
<P>There are two components to an email system on Linux: the mail user agent (called an MUA) that is your interface to the mail package on which you write and read mail and the underlying mail transport agent (called an MTA) that handles the sending and receiving of the mail.
</P>
<P>There are two MTAs in common use with Linux called <TT>sendmail</TT> and <TT>smail</TT>, and literally dozens of MUAs available. There are probably more versions of email MTAs and MUAs available for Linux than any other software application, with the possible exception of editors. The most widely used email MTA system for Linux is <TT>sendmail,</TT> which is based on an email system developed at the University of California at Berkeley. There are several versions of <TT>sendmail</TT> available for Linux, each with slightly different capabilities. Another commonly used email system for Linux is <TT>smail</TT>, developed by Curt Noll and Ronald Karr. Again, there are several versions of <TT>smail</TT> currently available for Linux.</P>
<P>Because both <TT>sendmail</TT> and <TT>smail</TT> are supplied with most CD-ROM distributions of Linux, you may not be sure about which mail system you should use. For small installations (such as a typical Linux machine, either standalone or networked to others), either will work fine. In some ways, <TT>smail</TT> is slightly easier to configure and use, primarily because it is a more modern product. However, for larger systems or those with special configuration requirements, <TT>sendmail</TT> is more flexible and offers more configuration capabilities.</P>
<H3><A NAME="Heading2"></A><FONT COLOR="#000077">How Email Works</FONT></H3>
<P>When you write a mail message using one of the mail user agent (MUA) user interface programs (such as Elm, Pine, or mail) on your Linux system, the application passes the message to the mail transfer agent (MTA), such as <TT>sendmail</TT> or <TT>smail</TT>. You can have several MTAs running (such as one package for LAN-based email delivery and another for UUCP delivery), although most systems use only one for convenience. The MUAs don’t actually pass the message to <TT>sendmail</TT> or <TT>smail</TT> but to a generic delivery transport called <TT>rmail</TT>, which is usually aliased to the specific MTA you want to use.</P>
<P>If the mail message is for someone on the local area network (or even the same machine), the MTA should be able to figure out this information from the address. MTAs must be able to understand aliasing, as well, in case you call machines, networks, or users by different names. If the message is for a remote system user, the MTA must be able to establish a connection to a mail machine somewhere along the route to the destination and transfer the mail. The connection can be either UUCP- or TCP-based. If the latter is used, a transfer protocol called Simple Mail Transfer Protocol (SMTP) is often employed. The MTA must also be able to handle problems with the delivery of mail, such as when the destination machine is unavailable or the user doesn’t exist. In this case, the mail is “bounced” or returned to the sender with an error message.</P>
<P>The routing of the mail messages to the destination is an important aspect of the MTA software and differs depending on which addressing scheme is used. For TCP-based addressing (usually using domain names), the default action is for an MTA to deliver messages to the destination machine based on the IP address and ignore the routing, leaving that to the IP software in the TCP/IP drivers.</P>
<H3><A NAME="Heading3"></A><FONT COLOR="#000077">Configuring sendmail</FONT></H3>
<P>The most commonly used email program is <TT>sendmail</TT> which is supplied with most Linux versions. The <TT>sendmail</TT> system is extremely powerful and flexible, and because of these very attributes can, at times, be annoying and difficult to configure and administer. However, setting up <TT>sendmail</TT> and managing its use for most common email tasks is quite easy, as this chapter will show you. For those of you who have elected to use <TT>sendmail</TT> as your mail system, you will find this chapter provides enough information to satisfy all but the most complex networked system.</P>
<P>Because of the complexity of <TT>sendmail</TT>, it is often teamed with a utility called <TT>IDA</TT>, for a combined product often known as <TT>sendmail+IDA</TT>. <TT>IDA</TT> makes <TT>sendmail</TT> much easier to use and is the most common method of using <TT>sendmail</TT> with Linux. Indeed, with <TT>IDA</TT> in tow, <TT>sendmail</TT> becomes the easiest mail transport package available for Linux.</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>Tip: </B><BR>If your system doesn’t have <TT>sendmail+IDA</TT> but offers only <TT>sendmail</TT>, you may want to consider getting <TT>sendmail+IDA</TT> from an FTP or BBS site. The convenience <TT>sendmail+IDA</TT> offers far outweighs any hassles in obtaining the files. Some current Linux releases are offering <TT>sendmail</TT> version 8, which is usually not supplied with IDA. Check the FTP or BBS sites for more information about <TT>sendmail+IDA</TT> for this (and later) releases.<HR></FONT>
</BLOCKQUOTE>
<P>The <TT>sendmail</TT> system by itself (without <TT>IDA</TT>) is configured primarily through a file which is usually stored as <TT>/etc/sendmail.cf</TT> (although some systems place the file in <TT>/usr/lib/sendmail.cf</TT> or other locations). The language used in the <TT>sendmail.cf</TT> file is completely different from other configuration files and is very complex. To see for yourself, examine the <TT>sendmail.cf</TT> file and try to make sense of it!</P>
<P>The <TT>sendmail.cf</TT> file handles the default actions of the <TT>sendmail</TT> system. There are several other files involved in the configuration, too. These are:</P>
<DL>
<DD><B>•</B> <TT>decnetxtable:</TT> converts generic addresses to DECnet addresses
<DD><B>•</B> g<TT>enericfrom:</TT> converts internal addresses into generic ones
<DD><B>•</B> <TT>mailertable:</TT> defines any special treatment for remote hosts and domains
<DD><B>•</B> <TT>pathtable:</TT> defines the UUCP paths to remote machines and domains
<DD><B>•</B> <TT>uucpxtable:</TT> forces the delivery of UUCP mail from DNS addresses
<DD><B>•</B> <TT>uucprelays:</TT> allows shortcuts to remote hosts
<DD><B>•</B> <TT>xaliases:</TT> converts generic addresses to internal ones
</DL>
<P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="../ch39/696-700.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="704-706.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -