⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lsg35.htm

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTM
📖 第 1 页 / 共 3 页
字号:


<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>

 -->


























<LINK REL="ToC" HREF="index.htm">







<LINK REL="Index" HREF="htindex.htm">







<LINK REL="Next" HREF="lsg36.htm">



















<A NAME="I0"></A>







<H2>Linux System Administrator's Survival Guide lsg35.htm</H2>







<P ALIGN=LEFT>







































<HR ALIGN=CENTER>







<P>







<UL>







<UL>







<UL>







<LI>







<A HREF="#E68E195" >Configuring sendmail</A>







<UL>







<LI>







<A HREF="#E69E219" > The sendmail.cf File</A>







<LI>







<A HREF="#E69E220" >UUCP-Specific Modifications</A>







<LI>







<A HREF="#E69E221" >Configuration Table Locations</A>







<LI>







<A HREF="#E69E222" >Configuring decnetxtable</A>







<LI>







<A HREF="#E69E223" >Configuring domaintable</A>







<LI>







<A HREF="#E69E224" >Configuring genericfrom</A>







<LI>







<A HREF="#E69E225" >Configuring mailertable</A>







<LI>







<A HREF="#E69E226" >Configuring pathtable</A>







<LI>







<A HREF="#E69E227" >Configuring uucprelays</A>







<LI>







<A HREF="#E69E228" > Configuring uucpxtable</A>







<LI>







<A HREF="#E69E229" >Building sendmail.cf from sendmail.m4</A></UL>







<LI>







<A HREF="#E68E196" >Using sendmail Version 8</A>







<UL>







<LI>







<A HREF="#E69E230" >Configuring sendmail</A>







<LI>







<A HREF="#E69E231" >Using the sendmail Templates</A></UL>







<LI>







<A HREF="#E68E197" >Summary</A></UL></UL></UL>







<HR ALIGN=CENTER>







<A NAME="E66E40"></A>







<H1 ALIGN=CENTER>







<CENTER>







<FONT SIZE=6 COLOR="#FF0000"><B>Chapter 35</B></FONT></CENTER></H1>







<BR>







<A NAME="E67E43"></A>







<H2 ALIGN=CENTER>







<CENTER>







<FONT SIZE=6 COLOR="#FF0000"><B>Configuring sendmail</B></FONT></CENTER></H2>







<BR>







<P>The most commonly used e-mail program is sendmail, which is supplied with most Linux versions. The sendmail system is extremely powerful and flexible, but it can at times be annoying and difficult to configure and administer because of these very attributes. Setting up sendmail and managing its use for most common e-mail tasks,however, is quite easy, as this chapter will show you. If you are planning to to use sendmail as your mail system, you will find that this chapter provides enough information for all but the most complex networked system.







<BR>







<P>Before getting started, note that this chapter shows you how to set up more than sendmail. Because sendmail is complex (the best reference manual to the mailer approaches 800 pages), it is often teamed with a utility called IDA, for a combined product often known as sendmail+IDA. IDA makes sendmail much easier to use and is the most common method of using sendmail with Linux. Indeed, with IDA in tow, sendmail becomes the easiest mail transport package available for Linux.







<BR>







<P>If your system offers only a sendmail version prior to release 8, consider getting sendmail+IDA from an FTP or BBS site. The convenience sendmail+IDA offers far outweighs any hassles in obtaining the files. Some current Linux releases are offering sendmail version 8, which is usually not supplied with IDA. Version 8 of sendmail is considerably easier to set up than previous versions, and because this version is now supplied with most Slackware Linux CD-ROMs (including the one supplied with this book), this chapter also covers sendmail version 8 (without IDA). Check the FTP or BBS sites for more information about sendmail+IDA for this (and later) releases.







<BR>







<BR>







<A NAME="E68E195"></A>







<H3 ALIGN=CENTER>







<CENTER>







<FONT SIZE=5 COLOR="#FF0000"><B>Configuring sendmail</B></FONT></CENTER></H3>







<BR>







<P>The sendmail system by itself (without IDA) is configured primarily though a file usually stored as /etc/sendmail.cf (although some systems place the file in /usr/lib/sendmail.cf or other locations). The language used in the sendmail.cf file is completely different than other configuration files and is very complex. To see for yourself, examine the sendmail.cf file and try to make sense of it.







<BR>







<P>The sendmail.cf file handles the default actions of the sendmail system. Several other files are involved in the configuration, too:







<BR>















<TABLE  BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 >







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







decnetxtable







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Converts generic addresses to DECnet addresses</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







genericfrom







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Converts internal addresses into generic ones</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







mailertable







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Defines any special treatment for remote hosts and domains</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







pathtable







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Defines the UUCP paths to remote machines and domains</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







uucpxtable







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Forces the delivery of UUCP mail from DNS addresses</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







uucprelays







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Allows shortcuts to remote hosts</FONT>







<TR>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







xaliases







</FONT>







<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>







Converts generic addresses to internal ones</FONT>







</TABLE><P>These tables are detailed later in this chapter. As mentioned, all the sendmail configuration files are difficult to edit manually. Using sendmail+IDA makes configuration much easier, as IDA handles configuration through table-driven options. Each table has a much simpler syntax than the sendmail.cf file.







<BR>







<P>The sendmail+IDA system uses a preprocessor such as m4 or dbm to generate the proper configuration files after you have specified values for many parameters. After using the preprocessor, the system uses a Makefile to create the final configuration files.







<BR>







<BR>







<A NAME="E69E219"></A>







<H4 ALIGN=CENTER>







<CENTER>







<FONT SIZE=4 COLOR="#FF0000"><B> The sendmail.cf File</B></FONT></CENTER></H4>







<BR>







<P>When you use sendmail+IDA, the sendmail.cf file is not edited directly. Instead, a configuration process generates the changes. The configuration routine is driven by a file called sendmail.m4, which provides basic information about your system's name, the pathnames used on your system, and the default mailer used. Although the sendmail.m4 file can get pretty long, it needs only basic information for most Linux installations that use UUCP or SMTP for mail transfers.







<BR>







<BLOCKQUOTE>







<BLOCKQUOTE>







<HR ALIGN=CENTER>







<BR>







<NOTE>Many system administrators like to rename sendmail.m4 to match their system name (such as tpci.m4) in order to prevent the file from being overwritten by accident and to make it obvious which machine the file refers to. If you choose to rename your file, alter all references to sendmail.m4 in this chapter to reflect your new filename.</NOTE>







<BR>







<HR ALIGN=CENTER>







</BLOCKQUOTE></BLOCKQUOTE>







<P>One of the most important sections of the sendmail.m4 file is the area that defines directories. This area usually starts with a line defining LIBDIR:







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">dnl #define(LIBDIR, /usr/local/lib/mail)</FONT></PRE>







<P>The LIBDIR directory is where sendmail+IDA looks for configuration files and routing tables. Usually this line is left alone, as the default path is the general location for all Linux mail systems. If the path shown in the sendmail.m4 file is correct, don't modify the file. This path is usually hardcoded into the sendmail binary, and doesn't need to be overwritten by the sendmail.m4 file (or its generated sendmail.cf file). If you need to change this path, you have to remove the dnl from the beginning of the line (which essentially makes the line a comment), add the correct path, and then rebuild sendmail.cf.







<BR>







<P>The local mailer used by sendmail is defined in the line that contains the variable LOCAL_MAILER_DEF:







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">define(LOCAL_MAILER_DEF, mailers.linux)dnl</FONT></PRE>







<P>This line is necessary because sendmail doesn't handle mail delivery. Another program takes care of this step instead. By default, the value used for the local mailer (which is almost always deliver) is contained in a file called mailers.linux. This file is referenced in the LOCAL_MAILER_DEF entry in the sendmail.m4 file, which means you need to check the mailers.linux file in the same subdirectory (usually /usr/local/lib/mail/mailers.linux) to ensure the deliver program (or whatever delivery agent you use) is properly entered. A typical mailers.linux file looks like the following:







<BR>







<PRE>







<FONT COLOR="#000080"># mailers.linux







Mlocal, P=/usr/bin/deliver, F=SlsmFDMP, S=10, R=25/10, A=deliver $u







Mprog, P=/bin/sh, F=lsDFMeuP, S=10, A=sh -c $u</FONT></PRE>







<P>The deliver mail delivery agent is also specified in the file Sendmail.mc, which is used to build sendmail.cf. If the name of your delivery agent is not deliver, check the Sendmail.mc file to make sure your mail delivery agent is properly specified. (If you are using deliver, don't worry about this file.) The Sendmail.mc file is important and must be read in when sendmail.m4 is processed. There is usually a line in sendmail.m4 that makes sure this action occurs. The line, which usually occurs at the top of the sendmail.m4 file, looks like the following:







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">include(Sendmail.mc)dnl</FONT></PRE>







<P>You may need to specify some entries in the PSEUDODOMAINS variable. This variable is used to handle systems that can't expand into domain names properly, usually UUCP networks. The entries in the PSEUDODOMAINS field tells sendmail+IDA not to use DNS for these networks (which would always fail). Typically, the PSEUDODOMAINS variable is set to the following values:







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">define(PSEUDODOMAINS, BITNET UUCP)dnl</FONT></PRE>







<P>You can use the PSEUDONYMS variable to hide your machine names from the outside world. For example, a mail recipient on another network sees only the address tpci.com regardless of whether mail was sent from merlin.tpci.com or chatton.tpci.com. When you use the PSEUDONYMS variable, sendmail accepts mail from all machines identified in the PSEUDONYMS field. The PSEUDONYMS field is usually used as shown in the following line:







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">define(PSEUDONYMS, tpci.com)dnl</FONT></PRE>







<P>This entry lets any machine with the network type tpci.com send mail through sendmail.







<BR>







<P>To define the name of your local machine, you use the DEFAULT_HOST variable. This variable is usually defined as the same name as your mail server (or your basic machine's name if you are not on a network). For example, you can use the following entry to set the default mail server's name:







<BR>







⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -