📄 lsg35.htm
字号:
<PRE>
<FONT COLOR="#000080">make sendmail.cf</FONT></PRE>
<P>or substitute your site name if you renamed your sendmail.m4 file to reflect your site name. (In other words, if you created a file called tpci.m4, specify tpci.cf in the command).
<BR>
<P>Once the file has been processed, copy it to the /etc directory (which is where the file normally resides) and start up sendmail with the command
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">/usr/lib/sendmail -bd -q1h</FONT></PRE>
<P>or reboot your machine (as sendmail usually starts from the rc startup files).
<BR>
<BR>
<A NAME="E68E196"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Using sendmail Version 8</B></FONT></CENTER></H3>
<BR>
<P>The latest version of sendmail supplied for most Linux systems is version 8. If you didn't see versions 6 or 7, don't worry; they didn't exist. The sendmail system jumped from release 5.X to 8. As of the date of publication, sendmail8+IDA wasn't in general distribution, but it should be available by the time you read this. There are several releases of sendmail version 8, just to make life more complicated. They are all pretty much the same as far as installation and configuration are concerned.
<BR>
<P>Most Linux CD-ROMs have the source code for sendmail version 8 already compiled into a binary. If you do not have the binary, change to the source directory and use the make command. The Slackware CD-ROM includes the precompiled binaries.
<BR>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE>Each release of sendmail version 8 has an installation guide included. On the Slackware CD-ROM release accompanying this book, the installation guide is in the directory /usr/doc/sendmail/op as the file op.me. To format and display this file properly on the screen, use the following command:</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<UL>
<UL>
<BR>
<PRE>
<FONT COLOR="#000080">nroff -me op.me | more</FONT></PRE></UL></UL>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE>If you want to send the output to the printer instead, replace the more command with lp, or save the output to a file and print that file directly.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<P>For the most part, sendmail version 8 is similar in configuration details to the other releases of sendmail. One change is the inclusion of four different UUCP mail routines. Choose one of the four UUCP versions based on the following features:
<BR>
<UL>
<LI>uucp-old (same as uucp) is 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). Use this version only if you need compatibility with old-style UUCP systems.
<BR>
<BR>
<LI>uucp-new (previously known as suucp) is the same as UUCP except it provides the rmail command to allow several recipients. This version is not much of an improvement over uucp-old.
<BR>
<BR>
<LI>uucp-dom allows domain name-style addressing. This version may not be compatible with some systems you have to connect to.
<BR>
<BR>
<LI>uucp-uudom is a combination of uucp-new and uucp-dom to provide the best features of both. It allows bang- and DNS-style addresses with proper handling of headers.
<BR>
<BR>
</UL>
<P>Whichever version of UUCP you choose, copy or link it to the normal UUCP binary on your Linux system.
<BR>
<BR>
<A NAME="E69E230"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Configuring </B><B>sendmail</B></FONT></CENTER></H4>
<BR>
<P>As mentioned earlier in this chapter, the sendmail configuration files are daunting to say the least. To make matters easier for administrators, a number of templates are supplied with version 8 that cover most of the common installation configurations. You have to copy one of these templates over the sendmail configuration file and change a few parameters relating to your specific system, but you can leave the majority of the file. Using these templates greatly shortens and simplifies the installation process. (If none of these templates suits your installation, you must manually adjust the configuration file. This process is beyond the scope of this book, so check the supplied documentation for more information.)
<BR>
<P>The sendmail system uses a number of directories to hold the files it needs, including the configuration file templates. Most of these files are processed by the macro language processor m4. The directories and their contents are as follows:
<BR>
<TABLE BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 >
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
cf
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
This directory provides descriptions of hosts used by sendmail. The raw data files end in .mc (for master configuration) and are used as input; the output produces a file ending with .cf.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
hack
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
This directory is a list of hacks used by the m4 macros to provide fixes or extra specifications. These should be avoided as much as possible. The information they supply is properly provided in the main configuration files.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
m4
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
This directory contains files with information applicable to all configuration files (site-independent information).</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
mailer
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
This directory contains files defining the mailers that are used by m4. The files generally provide information for local, UUCP, USENET, fax software, and similar types of mailers.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
ostype
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
This directory contains files describing the operating system and its environment.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
sh
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
This directory contains shell files used by m4.</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
siteconfig
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
This directory contains local site information.</FONT>
</TABLE><P>A number of files are important to the sendmail installation and configuration process. These files, their ownership and permission settings (where appropriate), and their purposes are as follows:
<BR>
<UL>
<LI>The /usr/sbin/sendmail file is the sendmail binary (the location can change, for example to /usr/lib/sendmail, depending on your installation setup). The file should be owned by root and have permissions set to 553.
<BR>
<BR>
<LI>The /etc/sendmail.cf file is the configuration file used by sendmail. This file is sometimes installed as /usr/lib/sendmail.cf.
<BR>
<BR>
<LI>The /usr/bin/newaliases file is a symbolic link to the sendmail binary. Create it with the command ln -s /usr/sbin/sendmail /usr/bin/newaliases if the link isn't already installed.
<BR>
<BR>
<LI>The /var/spool/mqueue directory is used to hold the mail queue. Create this directory with root as the owner and permissions set to 700. Some installations may prefer the directory /usr/spool/mqueue.
<BR>
<BR>
<LI>The /etc/aliases file contains system aliases. This file should include the aliases provided in the lib/aliases file under the sendmail distribution directory.
<BR>
<BR>
</UL>
<P>In order to start sendmail automatically when your Linux system boots, modify the /etc/rc files to include these lines (if they don't already exist):
<BR>
<PRE>
<FONT COLOR="#000080">if [ -f /usr/sbin/sendmail -a -f /etc/sendmail.cf ]; then
(cd /var/spool/mqueue; rm -f [lnx]f*)
/usr/sbin/sendmail -bd -q30m &
echo -n ' sendmail' >/dev/console
fi</FONT></PRE>
<P>The directory paths should reflect the paths used on your system, of course. The rm command used in this script removes any lock files that are left over from the system after the last shutdown.
<BR>
<BR>
<A NAME="E69E231"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Using the sendmail Templates</B></FONT></CENTER></H4>
<BR>
<P>The Slackware Linux distribution that accompanies this book, and most other releases of Linux that provide sendmail version 8, have a few templates provided that set most of the needed parameters. The templates on the Linux CD-ROM accompanying this book are as follows:
<BR>
<UL>
<LI>The cf/linux.smtp.mc template is for systems directly connected to the Internet (the default configuration).
<BR>
<BR>
<LI>The cf/linux.nodns-smtp.mc template is similar to the above configuration but it's for systems with no nameserver (such as most small LANs).
<BR>
<BR>
<LI>The cf/linux.uucp.mc template is for for UUCP-based connections.
<BR>
<BR>
</UL>
<P>If you choose to use one of the template files, examine it carefully to make sure the directories and system names are correct for your system. Make any changes directly into the file. To install one of these configuration files (or any other that you may find that suits your needs), issue the command
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">m4 config_file.mc > /etc/sendmail.cf</FONT></PRE>
<P>where config_file.mc is the configuration file you want to install. This command executes the macro language processor and copies the resulting file over the standard sendmail co<A NAME="I2"></A>nfiguration file.
<BR>
<BR>
<A NAME="E68E197"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Summary</B></FONT></CENTER></H3>
<BR>
<P>This chapter examined the configuration process for sendmail+IDA, the most common form of sendmail used with Linux. If you plan on using smail instead, read <A HREF="lsg36.htm">Chapter 36</A>.
<P ALIGN=LEFT>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -