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

📄 708-711.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=708-711//-->

<!--UNASSIGNED1//-->

<!--UNASSIGNED2//-->



<CENTER>

<TABLE BORDER>

<TR>

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

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

<TD><A HREF="711-714.html">Next</A></TD>

</TR>

</TABLE>

</CENTER>

<P><BR></P>

<H4 ALIGN="LEFT"><A NAME="Heading6"></A><FONT COLOR="#000077">Building sendmail.cf from sendmail.m4</FONT></H4>

<P>Now that you have configured the <TT>sendmail.m4</TT> file and its dependent files, you can generate the <TT>sendmail.cf</TT> file. This is done with the m4 processor. When the <TT>sendmail.m4</TT> file is ready to be processed, issue the command</P>

<!-- CODE SNIP //-->

<PRE>

make sendmail.cf

</PRE>

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

<P>or you can substitute your site name if you renamed your <TT>sendmail.m4</TT> file to reflect your site name (in other words, if you created a file called <TT>tpci.m4</TT>, you should specify <TT>tpci.cf</TT> in the command).</P>

<P>After the file has been processed, copy it to the <TT>/etc</TT> directory (which is where the file normally resides) and start up <TT>sendmail</TT> with the command</P>

<!-- CODE SNIP //-->

<PRE>

/usr/lib/sendmail -bd -q1h

</PRE>

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

<P>or reboot your machine (because <TT>sendmail</TT> usually starts from the <TT>rc</TT> startup files). The exact paths may be different with your system, so check where these configuration files are stored.</P>

<H3><A NAME="Heading7"></A><FONT COLOR="#000077">Using sendmail Version 8</FONT></H3>

<P>The latest version of <TT>sendmail</TT> supplied for most Linux systems is version 8. If you didn&#146;t see versions 6 or 7, don&#146;t worry: They never existed. The <TT>sendmail</TT> system jumped from release 5.X to 8. (One of the important additions to version 8 of s<TT>endmail</TT> is the anti-spam filters that lets you remove spam email. If you are getting a lot of spam, this feature alone is worth the upgrade trouble!)</P>

<P>For the most part, <TT>sendmail</TT> version 8 is similar in configuration details to the other releases of <TT>sendmail</TT>. One change is the inclusion of four different UUCP mail routines. Choose one of the four UUCP versions based on the following features:</P>

<DL>

<DD><B>&#149;</B>&nbsp;&nbsp;<TT>uucp-old</TT> (same as &#147;<TT>uucp</TT>&#148;) Classic UUCP that uses a bang-style address and can send to only one address at a time (duplicate messages are sent when multiple recipients are specified). This version should be used only if you really need compatibility with old-style UUCP systems.

<DD><B>&#149;</B>&nbsp;&nbsp;<TT>uucp-new</TT> (previously know as &#147;suucp&#148;) The same as UUCP except that it provides the <TT>rmail</TT> command to allow several recipients. This version is not much of an improvement over <TT>uucp-old</TT>.

<DD><B>&#149;</B>&nbsp;&nbsp;<TT>uucp-dom</TT> Allows domain name-style addressing. May not be compatible with some systems you may have to connect to.

<DD><B>&#149;</B>&nbsp;&nbsp;<TT>uucp-uudom</TT> A combination of <TT>uucp-new</TT> and <TT>uucp-dom</TT> to provide the best features of both. Allows bang- and DNS-style addresses with proper handling of headers.

</DL>

<P>Whichever version of UUCP you choose, it should be copied or linked to the normal UUCP binary on your Linux system.

</P>

<H3><A NAME="Heading8"></A><FONT COLOR="#000077">smail</FONT></H3>

<P>The <TT>smail</TT> mail system is similar to the <TT>sendmail</TT> system in most of its actions, although the configuration process is different. In some ways, <TT>smail</TT> is easier to work with than <TT>sendmail</TT> and can be a good choice for smaller systems. If you choose to use <TT>smail</TT> as your mailer, you will have to make some manual modifications to configuration files because there are few automated or scripted routines available.</P>

<P>The <TT>smail</TT> system has many options and configuration details, most of which are never used. We&#146;ll look at the primary controlling parameters that most Linux users will need, and essentially ignore those that are very seldom (if ever) used in real situations. For more information on the options and configuration controls we skip over in this chapter, see the man pages or <TT>smail</TT> documentation. We&#146;ll focus this chapter on showing you how to get <TT>smail</TT> up and running quickly and easily to handle the situations most Linux systems will find themselves working with.</P>

<H4 ALIGN="LEFT"><A NAME="Heading9"></A><FONT COLOR="#000077">Setting Up smail</FONT></H4>

<P>The <TT>smail</TT> system requires several links to exist so <TT>smail</TT> can execute properly. The two most important links are to the <TT>files /usr/bin/rmail</TT> and <TT>/usr/lib/sendmail</TT> (sometimes located as <TT>/usr/sbin/sendmail</TT>, depending on the version of Linux). These links are necessary because most user mail applications send outgoing mail to either <TT>rmail</TT> or <TT>sendmail</TT> (depending on the mail software), and this has to be redirected to <TT>smail</TT>. Links allow this redirection to occur transparently without altering the user mail applications.</P>

<P>You should verify that the <TT>rmail</TT> and <TT>sendmail</TT> files are linked to <TT>smail</TT>, and if not, establish the links. Usually, the links established are symbolic and will show in a direc-tory listing with an entry like this:</P>

<!-- CODE SNIP //-->

<PRE>

lrwxrwxrwx  1 root  root   6 Sep 16:35  file1 -&gt; file2

</PRE>

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

<P>The arrow (-&gt;) shows that a symbolic link exists. (For more information on links and symbolic links, see Chapter 8, &#147;Using the File System.&#148;) Check both the <TT>rmail</TT> and <TT>sendmail</TT> binaries for these symbolic links. If the symbolic links do not exist already, create them with the following commands:</P>

<!-- CODE SNIP //-->

<PRE>

ln -s /usr/local/bin/smail /usr/bin/rmail

ln -s /usr/local/bin/smail /usr/lib/sendmail

</PRE>

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

<P>Of course you should substitute whatever directory pathnames are valid on your system for <TT>smail</TT>, <TT>sendmail</TT>, and <TT>rmail</TT>. After you have created the links, verify that they exist by displaying the directories and look for the symbolic link notation shown earlier.</P>

<P>If there is the possibility of mail either entering or leaving your system through an SMTP channel, you should also establish a link between the <TT>smail</TT> program and the SMTP system. Use the command:</P>

<!-- CODE SNIP //-->

<PRE>

ln -s /usr/local/bin/smail /usr/sbin/smtpd

</PRE>

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

<P>to set up the link (substituting proper paths for your system). Next, the SMTP service has to be allowed through the TCP configuration files. This is enabled by setting the <TT>/etc/services</TT> file to specifically allow SMTP connections. There is a line in the <TT>/etc/services</TT> file that looks like</P>

<!-- CODE SNIP //-->

<PRE>

smtp  25/tcp  # Simple Mail Transfer Protocol

</PRE>

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

<P>which you should verify to be not commented out (indicated by a pound sign as the first character). This allows the SMTP link to be established as TCP port number 25 (the default value).

</P>

<P>If you are going to leave <TT>smail</TT> as a daemon (started automatically with the system boot), ensure that the <TT>smail</TT> daemon is started in the <TT>rc</TT> files (such as <TT>rc.inet2</TT>). The usual command line for the <TT>smail</TT> daemon looks like this:</P>

<!-- CODE SNIP //-->

<PRE>

/usr/local/bin/smail -bd -q15m

</PRE>

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

<P>The <TT>-bd</TT> option turns the daemon operation of <TT>smail</TT> on, which the <TT>-q15m</TT> tells <TT>smail</TT> to process messages every fifteen minutes. If you want more frequent mail delivery, change the value in the <TT>rc</TT> file. Alternatively, if you want mail processing less often to relieve a heavily loaded system, increase the value.</P><P><BR></P>

<CENTER>

<TABLE BORDER>

<TR>

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

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

<TD><A HREF="711-714.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 + -