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

📄 lsg36.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="lsg37.htm">



















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







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







<P ALIGN=LEFT>







































<HR ALIGN=CENTER>







<P>







<UL>







<UL>







<UL>







<LI>







<A HREF="#E68E198" >How smail Handles Mail</A>







<LI>







<A HREF="#E68E199" >Setting Up smail</A>







<UL>







<LI>







<A HREF="#E69E232" >Configuring smail For UUCP</A>







<UL>







<LI>







<A HREF="#E70E3" >Setting the Local Domain Names</A>







<LI>







<A HREF="#E70E4" >Setting the Local Domain for Outgoing Mail</A>







<LI>







<A HREF="#E70E5" >Alternate UUCP Names</A>







<LI>







<A HREF="#E70E6" >Setting a UUCP Smart Host</A></UL>







<LI>







<A HREF="#E69E233" >Configuring smail for TCP Use</A>







<LI>







<A HREF="#E69E234" >Using Other Options</A>







<UL>







<LI>







<A HREF="#E70E7" >Setting an Authoritative Domain Name</A>







<LI>







<A HREF="#E70E8" >Setting the Delivery Mode</A>







<LI>







<A HREF="#E70E9" >Setting the Postmaster</A></UL>







<LI>







<A HREF="#E69E235" >Debugging smail</A></UL>







<LI>







<A HREF="#E68E200" > Modifying smail's Behavior</A>







<LI>







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







<HR ALIGN=CENTER>







<A NAME="E66E41"></A>







<H1 ALIGN=CENTER>







<CENTER>







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







<BR>







<A NAME="E67E44"></A>







<H2 ALIGN=CENTER>







<CENTER>







<FONT SIZE=6 COLOR="#FF0000"><B>Using smail</B></FONT></CENTER></H2>







<BR>







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







<BR>







<P>The smail system has many options and configuration details, most of which are never used. This chapter looks at the primary controlling parameters that most Linux users may need and essentially ignores those that are very seldom (if ever) used in real situations. For more information on the options and configuration controls not covered in this chapter, see the man pages or smail documentation. Essentially, this chapter shows you how to get smail up and running quickly to handle the situations most Linux systems will find themselves working with.







<BR>







<BR>







<A NAME="E68E198"></A>







<H3 ALIGN=CENTER>







<CENTER>







<FONT SIZE=5 COLOR="#FF0000"><B>How smail Handles Mail</B></FONT></CENTER></H3>







<BR>







<P>The smail system is governed by a daemon that is usually started when the system enters multiuser run mode. From then on, smail watches for incoming connections (TCP or UUCP, usually), and it processes any incoming mail when it is received. Because smail runs as a daemon, this allows fast processing and delivery of incoming mail without having to physically start a mail program at intervals. When mail is received through a UUCP connection, the rmail program is often called to handle the delivery of the mail.







<BR>







<P>The smail system was designed to process incoming mail immediately, routing it to the receiver. You can override this in the main configuration file, usually called /usr/lib/smail/config, which may be necessary in high-traffic situations or when a machine is heavily loaded. When desired, the inetd daemon can handle incoming mail traffic and spawn smail to handle the delivery at specific intervals. However, using smail as a daemon generally involves less overhead and system resources than spawning it every time mail has to be handled, so the daemon approach is recommended.







<BR>







<P>The smail system handles outgoing mail through the use of a connection to a user's mailer. For example, if you send a message from one of the Linux mailer agents such as Elm or mail, that application sends the mail and recipient names to the rmail (usually /usr/bin/rmail) program for delivery. Some mail agents send outgoing mail to the sendmail program instead of rmail, which also has to be accounted for. As you will see in the next section, both incoming and outgoing mail is usually handled by creating links between smail, rmail, and sendmail.







<BR>







<P>The smail mail-handling routine is broken into three distinct and separate parts: the router, the director, and the transport. The router handles address resolution and the way in which messages are sent between machines. The director handles forwarding and aliases that may be used in messages. The transport handles the actual transfer of messages. Each of the three components can be configured separately within smail using separate files called routers, directors, and transports (which usually reside in the /usr/lib/smail directory with the smail configuration files). You will look at modifying the default behavior of each component later in this chapter.







<BR>







<P>Most Linux systems have the smail program reside in the directory /usr/local/bin, although a few other locations are popular as well. You need to know the exact directory path to smail in order to properly configure the system, so find the executable. You can locate its path with the following command:







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">find / -name smail -print</FONT></PRE>







<P>Note the output.







<BR>







<BR>







<A NAME="E68E199"></A>







<H3 ALIGN=CENTER>







<CENTER>







<FONT SIZE=5 COLOR="#FF0000"><B>Setting Up smail</B></FONT></CENTER></H3>







<BR>







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







<BR>







<P>Verify that the rmail and sendmail files are linked to smail, and if not, establish the links. Usually, the links established are symbolic, and they will show in a directory listing with an entry like this:







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">lrwxrwxrwx 1 root root 6 Sep 16:35 file1 -&gt; file2</FONT></PRE>







<P>The arrow (-&gt;) shows that a symbolic link exists. (For more information on links and symbolic links, see <A HREF="lsg18.htm">Chapter 18</A>, &quot;Filesystems and Disks.&quot;) Check both the rmail and sendmail binaries for these symbolic links. If the symbolic links do not exist already, create them with the following commands:







<BR>







<PRE>







<FONT COLOR="#000080">ln -s /usr/local/bin/smail /usr/bin/rmail







ln -s /usr/local/bin/smail /usr/lib/sendmail</FONT></PRE>







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







<BR>







<P>If mail may enter or leave your system through an SMTP channel, you should also establish a link between the smail program and the smtp system. Use the following command to set up the link (substituting proper paths for your system):







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">ln -s /usr/local/bin/smail /usr/sbin/smtpd</FONT></PRE>







<P>Next, the SMTP service has to be enabled through the TCP configuration files. You do this by setting the /etc/services file to specifically enable SMTP connections. There is a line in the /etc/services file that looks like this:







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">smtp 25/tcp # Simple Mail Transfer Protocol</FONT></PRE>







<P>Verify that this line is not commented out (has a pound sign as the first character). This line allows the SMTP link to be established as TCP port number 25 (the default value).







<BR>







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







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">/usr/local/bin/smail -bd -q15m</FONT></PRE>







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







<BR>







<P>If you decide not to run smail as a daemon and want it spawned by inetd whenever mail arrives, comment out the daemon lines in the rc files (usually rc.inet2). You cannot run smail in both daemon and spawned mode. Next, modify the /etc/inetd.conf file to contain an entry like the following:







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">smtp stream tcp nowait root /usr/sbin/smtpd smtpd</FONT></PRE>







<P>You must have the symbolic link between smtpd and the smail program for this command to function properly.







<BR>







<P>The configuration file changes necessary for smail depend on which connection system you use for obtaining mail. In other words, the configurations change if you are using UUCP (which is the easiest to set up) or a TCP connection on a network. This chapter looks at each of the configuration processes separately. You can follow both discussions, if you enable mail through both methods.







<BR>







<BR>







<A NAME="E69E232"></A>







<H4 ALIGN=CENTER>







<CENTER>







<FONT SIZE=4 COLOR="#FF0000"><B>Configuring smail For UUCP</B></FONT></CENTER></H4>

⌨️ 快捷键说明

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