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

📄 704-706.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 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=704-706//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="701-704.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="706-708.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<P>We will look at each of these tables in a little more detail in a moment. As mentioned, all the <TT>sendmail</TT> configuration files are difficult to edit manually. Using <TT>sendmail&#43;IDA</TT> makes life much easier because IDA handles configuration through table-driven options. Each has a much simpler syntax than the <TT>sendmail.cf</TT> file uses.</P>

<P>The <TT>sendmail&#43;IDA</TT> system uses a preprocessor such as m4 or dbm to generate the proper configuration files after you have specified values for many parameters. After the preprocessor, a makefile is used to create the final configuration files.</P>

<H4 ALIGN="LEFT"><A NAME="Heading4"></A><FONT COLOR="#000077">The sendmail.cf File</FONT></H4>

<P>When using <TT>sendmail&#43;IDA</TT>, the <TT>sendmail.cf</TT> file is not edited directly. Instead, a configuration process is used to generate the changes. The configuration routine is driven by a file called <TT>sendmail.m4</TT> which provides basic information about your system&#146;s name, the pathnames used on your system, and the default mailer used. While the <TT>sendmail.m4</TT> file can get pretty long, for most Linux installations that use UUCP or SMTP for mail transfers the file needs only basic information.</P>

<P>One important section of the <TT>sendmail.m4</TT> file is the definitions of directories. This area usually starts with a line defining <TT>LIBDIR</TT>, which look like this:</P>

<!-- CODE SNIP //-->

<PRE>

dnl #define(LIBDIR, /usr/local/lib/mail)

</PRE>

<!-- END CODE SNIP //-->

<P>The <TT>LIBDIR</TT> directory is where <TT>sendmail&#43;IDA</TT> looks for configuration files and routing tables. This is usually left alone since the default value is the general location for all Linux mail systems. If the path shown in the <TT>sendmail.m4</TT> file is correct, don&#146;t modify the file. This entry is usually hardcoded into the <TT>sendmail</TT> binary and doesn&#146;t need overwriting by the <TT>sendmail.m4</TT> file (or its generated <TT>sendmail.cf</TT> file). If you need to change this value, you will have to remove the &#147;<TT>dnl</TT>&#148; from the front of the line (which makes the line essentially a comment), then add the correct path and rebuild <TT>sendmail.cf</TT>.</P>

<P>The local mails used by <TT>sendmail</TT> is defined in the line that contains the variable <TT>LOCAL_MAILER_DEF</TT> and looks like this:</P>

<!-- CODE SNIP //-->

<PRE>

define(LOCAL_MAILER_DEF, mailers.linux)dnl

</PRE>

<!-- END CODE SNIP //-->

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

<!-- CODE SNIP //-->

<PRE>

# mailers.linux

Mlocal, P=/usr/bin/deliver, F=SlsmFDMP, S=10, R=25/10, A=deliver &#36;u

Mprog, P=/bin/sh, F=lsDFMeuP, S=10, A=sh -c &#36;u

</PRE>

<!-- END CODE SNIP //-->

<P>The <TT>deliver</TT> mail delivery agent is also specified in the file <TT>Sendmail.mc</TT>, which is used to build sendmail.cf. You need to check this <TT>Sendmail.mc</TT> file, too, if the name of your delivery agent is not <TT>deliver</TT>. (If you are using <TT>deliver</TT>, don&#146;t worry about this file.) The <TT>Sendmail.mc</TT> file is important and must be read in when <TT>sendmail.m4</TT> is processed. There is usually a line in <TT>sendmail.m4</TT> that makes sure this happens. The line, which usually occurs at the top of the <TT>sendmail.m4</TT> file, looks like this:</P>

<!-- CODE SNIP //-->

<PRE>

include(Sendmail.mc)dnl

</PRE>

<!-- END CODE SNIP //-->

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

<!-- CODE SNIP //-->

<PRE>

define(PSEUDODOMAINS, BITNET UUCP)dnl

</PRE>

<!-- END CODE SNIP //-->

<P>You can use the <TT>PSEUDONYMS</TT> field to hide your machine names from the outside world. This means that whether mail was sent from<TT>merlin.tpci.com</TT> or <TT>chatton.tpci.com</TT> doesn&#146;t matter: the recipient on another network sees only the address <TT>tpci.com</TT>. This is called &#147;hiding&#148; the local machines. When used, <TT>sendmail</TT> accepts mail from all machines identified in the <TT>PSEUDONYMS</TT> variable. The <TT>PSEUDONYMS</TT> field is usually used as shown in the following line:</P>

<!-- CODE SNIP //-->

<PRE>

define(PSEUDONYMS, tpci.com)dnl

</PRE>

<!-- END CODE SNIP //-->

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

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

<!-- CODE SNIP //-->

<PRE>

define(DEFAULT_HOST, merlin.tpci.com)dnl

</PRE>

<!-- END CODE SNIP //-->

<P>If you do not set a valid name for the <TT>DEFAULT_HOST</TT> variable, no mail will be returned properly to your system.</P>

<P>If your system is not a mail gateway to the Internet (or other networks that are accessible from your LAN), you can set your Linux system to send mail on to another machine for processing. This is done by setting the <TT>RELAY_HOST</TT> and <TT>RELAY_MAILER</TT> variables in <TT>sendmail.c4</TT>. These variables set the name of the mail server that all mail should be passed on to. For example, to set your local system to route all outbound mail to a machine called <TT>wizard</TT>, set these two lines to look like this:</P>

<!-- CODE SNIP //-->

<PRE>

define(RELAY_HOST, wizard)dnl

define(RELAY_MAILER, UUCP=A)dnl

</PRE>

<!-- END CODE SNIP //-->

<P>The <TT>RELAY_MAILER</TT> line specifies the mailer to use to send messages on to the <TT>RELAY_HOST</TT>.</P><P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

<TD><A HREF="701-704.html">Previous</A></TD>

<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>

<TD><A HREF="706-708.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 + -