?? 711-714.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=711-714//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="708-711.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="714-716.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P>If you decide not to run <TT>smail</TT> as a daemon and want it spawned by <TT>inetd</TT> whenever mail arrives, comment out the daemon lines in the <TT>rc</TT> files (usually <TT>rc.inet2</TT>). You cannot run <TT>smail</TT> in both daemon and spawned mode. Next, you should modify the <TT>/etc/inetd.conf</TT> file to contain an entry like this:</P>
<!-- CODE SNIP //-->
<PRE>
smtp stream tcp nowait root /usr/sbin/smtpd smtpd
</PRE>
<!-- END CODE SNIP //-->
<P>You must have the symbolic link between <TT>smtpd</TT> and the <TT>smail</TT> program for this command to function properly.</P>
<P>The configuration file changes necessary for <TT>smail</TT> 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. We can look at each of the configuration processes separately. You can follow both, if you allow mail through both methods.</P>
<H4 ALIGN="LEFT"><A NAME="Heading10"></A><FONT COLOR="#000077">Configuring smail for UUCP</FONT></H4>
<P>Configuring the <TT>smail</TT> system for use with UUCP incoming and outgoing mail messages is very simple. You need to edit the default <TT>smail</TT> configuration file, usually stored as <TT>/usr/lib/smail/config</TT>. Some versions of <TT>smail</TT> include a sample configuration file such as <TT>config.sample</TT> in the same directory. You can use either as a template for the UUCP modifications.</P>
<P>Use any ASCII editor to edit <TT>/usr/lib/smail/config</TT> (the path in your distribution may be different). There are four changes you need to make. The changes are for these variables:</P>
<DL>
<DD><B>•</B> <TT>visible_domain</TT> The domain names your site belongs to
<DD><B>•</B> <TT>visible_name</TT> Your site’s full domain name
<DD><B>•</B> <TT>uucp_name</TT> Your site’s UUCP-based name (usually the same as <TT>visible_name</TT>)
<DD><B>•</B> <TT>smart_host</TT> The name of the UUCP host
</DL>
<P>Each parameter in the <TT>/usr/lib/smail/config</TT> file uses the same format of <TT>variable=value</TT>. There should be no spaces on either side of the equals sign on any line. Comments in the file are preceded by a pound sign.</P>
<P><FONT SIZE="+1"><B>Setting the Local Domain Names</B></FONT></P>
<P>Begin by setting the domain name of the local machines. Locate the line in the <TT>/usr/lib/smail/config</TT> file that defines the variable <TT>visible_domain</TT>, which usually looks similar to this:</P>
<!-- CODE SNIP //-->
<PRE>
# Our domain name
visible_domain=tpci
</PRE>
<!-- END CODE SNIP //-->
<P>The <TT>visible_domain</TT> variable sets the domain names your site belongs to and will usually be the fully qualified domain name and any aliases that may be in effect. This field is used by <TT>smail</TT> to find out whether the recipient of a message is local or not. The <TT>smail</TT> system takes the message and extracts the recipient’s address, comparing it against the local machine name (from the hostname command) and all values specified on the <TT>visible_domain</TT> variable. If there is a match to any of these names, the message is for a local recipient. If no match occurs, the message is routed externally.</P>
<P>If there is more than one valid value for a local domain name, the values are separated by colons, as shown in this example:</P>
<!-- CODE SNIP //-->
<PRE>
visible_domain=tpci:tpci.com:tpci.UUCP
</PRE>
<!-- END CODE SNIP //-->
<P>If your site is properly registered on UUCP maps, add the domain “<TT>uucp</TT>” to the list of valid values, as well. In this example, we belong to the domain <TT>tpci</TT> (from the full domain name <TT>tpci.com</TT>) and <TT>uucp</TT>:</P>
<!-- CODE SNIP //-->
<PRE>
visible_domain=tpci:tpci.com:uucp
</PRE>
<!-- END CODE SNIP //-->
<P>You may have several variations of the local domain name on the <TT>visible_domain</TT> line to account for typographic errors, if you want.</P>
<P><FONT SIZE="+1"><B>Setting the Local Domain for Outgoing Mail</B></FONT></P>
<P>When a message is to be routed out of the local machine, the <TT>smail</TT> system appends the local machine’s full domain name as part of the routing information. The full local machine name is defined in the <TT>/usr/lib/smail/config</TT> line that deals with the <TT>visible_domain</TT> variable. The line will look something like this:</P>
<!-- CODE SNIP //-->
<PRE>
# Our domain name for outgoing mail
visible_name=tpci.com
</PRE>
<!-- END CODE SNIP //-->
<P>As a general rule, the <TT>visible_domain</TT> value must be a combination of the hostname and one of the domains given in the <TT>visible_domains</TT> variable; otherwise, the <TT>smail</TT> system may bounce incoming mail issued as a reply to mail sent from your site as being unrecognizable.</P>
<P>The <TT>visible_name</TT> value is usually your fully qualified domain name (if you have one) or a domain name that exists in other routing tables.</P>
<P><FONT SIZE="+1"><B>Alternate UUCP Names</B></FONT></P>
<P>The <TT>/usr/lib/smail/config</TT> file sometimes contains an entry for a variable called <TT>uucp_name</TT>. This variable is usually optional, as long as the variables <TT>visible_domain</TT> and <TT>visible_name</TT> are properly filled in. The <TT>uucp_name</TT> variable is used when the name of the system returned by the hostname command is not the name that is registered with the UUCP mapping tables. For example, your UUCP mapping name may be “<TT>darkstar</TT>” but you may have changed your machine’s name to “<TT>vader</TT>” for any number of reasons. The <TT>uucp_name</TT> variable can be used to correct this change, without requiring updates to the UUCP mapping tables.</P>
<P>To set a value for the <TT>uucp_name</TT> variable, look for (or create, if one doesn’t exist) the lines that define the variable. Usually, the lines look like this:</P>
<!-- CODE SNIP //-->
<PRE>
# UUCP mapping name
uucp_name=tpci.com
</PRE>
<!-- END CODE SNIP //-->
<P>If your name is properly registered as set in the <TT>visible_name</TT> variable, you can simply repeat the value in the <TT>uucp_name</TT> variable with no ill effects. If your site name has changed, enter the proper value instead.</P>
<P><FONT SIZE="+1"><B>Setting a UUCP Smart Host</B></FONT></P>
<P>Some systems use another machine as a smart host, which handles the routing of messages to and from other networks. If you are using a smart host, you should put its name in the <TT>/usr/lib/smail/config</TT> file next to the variable <TT>smart_host</TT>. Look for entries in the file that resemble these lines:</P>
<!-- CODE SNIP //-->
<PRE>
# Smart host
smart_host=merlin
</PRE>
<!-- END CODE SNIP //-->
<P>In this case, any mail for other networks is forwarded by <TT>smail</TT> to the machine merlin (in the fully resolved domain name <TT>merlin.tpci.com</TT>, based on the <TT>smart_host</TT> and <TT>visible_name</TT> variables). That machine can then take care of the routing out of the network. Any machine name given in the <TT>smart_host</TT> field must be reachable by UUCP, which means having a corresponding UUCP configuration entry. (See Chapter 39, “UUCP,” for more information.)</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="708-711.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="714-716.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 + -