📄 lsg36.htm
字号:
<BR>
<P>Configuring the smail system for use with UUCP incoming and outgoing mail messages is very simple. You need to edit the default smail configuration file, usually stored as /usr/lib/smail/config. Some versions of smail include a sample configuration file as config.sample in the same directory. You can use either as a template for the UUCP modifications.
<BR>
<P>Use any ASCII editor to edit /usr/lib/smail/config. You need to make four changes. The changes are for these variables:
<BR>
<TABLE BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 >
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
visible_domain
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
The domain names your site belongs to</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
visible_name
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Your site's full domain name</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
uucp_name
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Your site's UUCP-based name (usually the same as visible_name)</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
smart_host
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
The name of the UUCP host</FONT>
</TABLE><P>Each parameter in the /usr/lib/smail/config file uses the same format of variable=value. There should be no spaces on either side of the equal sign on any line. A pound sign precedes comments in the file.
<BR>
<BR>
<A NAME="E70E3"></A>
<H5 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Setting the Local Domain Names</B></FONT></CENTER></H5>
<BR>
<P>Begin by setting the domain name of the local machines. Locate the line in the /usr/lib/smail/config file that defines the variable visible_domain, which will usually look similar to this:
<BR>
<PRE>
<FONT COLOR="#000080"># Our domain name
visible_domain=tpci</FONT></PRE>
<P>The visible_domain variable sets the domain names your site belongs to, and it will usually be the fully qualified domain name and any aliases that may be in effect. This field is used by smail to find out if the recipient of a message is local or not. The smail 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 visible_domain 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.
<BR>
<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:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">visible_domain=tpci:tpci.com:tpci.UUCP</FONT></PRE>
<P>If your site is properly registered on UUCP maps, add the domain uucp to the list of valid values, as well. In this example, you belong to the domain tpci (from the full domain name tpci.com), and uucp:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">visible_domain=tpci:tpci.com:uucp</FONT></PRE>
<BR>
<A NAME="E70E4"></A>
<H5 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Setting the Local Domain for Outgoing Mail</B></FONT></CENTER></H5>
<BR>
<P>When a message is to be routed out of the local machine, the smail system appends the local machine's full domain name as part of the routing information. The full local machine name is defined in the /usr/lib/smail/config line that deals with the visible_domain variable. The line looks something like this:
<BR>
<PRE>
<FONT COLOR="#000080"># Our domain name for outgoing mail
visible_name=tpci.com</FONT></PRE>
<P>As a general rule, the visible_domain value must be a combination of the hostname and one of the domains given in the visible_domains variable. Otherwise, the smail system may bounce incoming mail issued as a reply to mail sent from your site as being unrecognizable.
<BR>
<P>The visible_name value is usually your fully qualified domain name (if you have one) or a domain name that exists in other routing tables.
<BR>
<BR>
<A NAME="E70E5"></A>
<H5 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Alternate UUCP Names</B></FONT></CENTER></H5>
<BR>
<P>The /usr/lib/smail/config file sometimes contains an entry for a variable called uucp_name. This variable is usually optional, as long as the variables visible_domain and visible_name are properly filled in. The uucp_name 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 darkstar, but you may have changed your machine's name to vader for any number of reasons. You can use the uucp_name variable to correct this change, without requiring updates to the UUCP mapping tables.
<BR>
<P>To set a value for the uucp_name variable, look for (or create, if one doesn't exist) the lines that define the variable. Usually, the lines look like this:
<BR>
<PRE>
<FONT COLOR="#000080"># UUCP mapping name
uucp_name=tpci.com</FONT></PRE>
<P>If your name is properly registered as set in the visible_name variable, you can simply repeat the value in the uucp_name variable with no ill effects. If your site name has changed, enter the proper value instead.
<BR>
<BR>
<A NAME="E70E6"></A>
<H5 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Setting a UUCP Smart Host</B></FONT></CENTER></H5>
<BR>
<P>Some systems use another machine as a smart host that handles the routing of messages to and from other networks. If you are using a smart host, you should put its name in the /usr/lib/smail/config file next to the variable smart_host. Look for entries in the file that resemble these lines:
<BR>
<PRE>
<FONT COLOR="#000080"># Smart host
smart_host=merlin</FONT></PRE>
<P>In this case, any mail for other networks is forwarded by smail to the machine merlin (in the fully resolved domain name merlin.tpci.com, based on the smart_host and visible_name variables). That machine can then take care of the routing out of the network. Any machine name given in the smart_host field must be reachable by UUCP, which means having a corresponding UUCP configuration entry. (See <A HREF="lsg27.htm">Chapter 27</A>, "UUCP," for more information.)
<BR>
<BR>
<A NAME="E69E233"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Configuring smail for TCP Use</B></FONT></CENTER></H4>
<BR>
<P>If you are going to use a network connection to transfer mail, you need to make modifications to the /usr/lib/smail/config file that specify the types of connections and host names. There are several different methods of configuring mail systems for a network. These methods include using NFS (Network File System) to allow a single configuration file shared by all machines, using POP (Post Office Protocol) or IMAP (Interactive Mail Access Protocol) to handle mail on a central site, and setting up each machine as an independent mail handler. The configuration process for all these methods is much the same. The difference is whether the configuration files reside on each machine in the network, or on a single machine that is then accessed by NFS or SMTP by other machines.
<BR>
<P>Start the configuration process by establishing the local domain names using the variables visible_domain and visible_name. These variables were discussed in detail in the section on configuring smail for UUCP., so the explanation will be limited to showing final examples of these two variables. An example of these variable definitions looks like this:
<BR>
<PRE>
<FONT COLOR="#000080"># Our domain name
visible_domain=tpci.com
# Our domain name for outgoing mail
visible_name=tpci.com</FONT></PRE>
<P>This code sets the local domain name and domain resolution names. The entry for visible_domain is used by smail to attach to all outgoing mail packages (instead of whatever name is generated by the hostname command). Both visible_domain and visible_name are often the same.
<BR>
<P>The next configuration step is to set the name of a smart host that handles out-of-network messages. If you are not using a smart host, or your machine handles the network connections itself, you won't need to enter these values. The variables involved in setting up a smart host are smart_path and smart_transport. The smart_path sets the machine name of the smart host (which must be resolvable with the domain name given in visible_domain). The smart_transport variable specifies the type of protocol to be used to connect to the smart host. Because most smart hosts communicate (for mail purposes, at least), with SMTP, that is the most often used value, as shown in this extract from a /usr/lib/smail/config file:
<BR>
<PRE>
<FONT COLOR="#000080"># smart host routing
# smart host name
smart_host=merlin
# communications protocol to smart host
smart_transport=smtp</FONT></PRE>
<P>The smart_transport value of smtp (lowercase letters only) is used to identify the SMTP connection protocol.
<BR>
<BR>
<A NAME="E69E234"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Using Other Options</B></FONT></CENTER></H4>
<BR>
<P>As mentioned at the start of this chapter, smail can use many configuration options and command line options, although most are of little interest to most Linux system users. A few of the options may be of interest if you want to modify the basic behavior of smail. This section examines these options.
<BR>
<BR>
<A NAME="E70E7"></A>
<H5 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Setting an Authoritative Domain Name</B></FONT></CENTER></H5>
<BR>
<P>Both UUCP and TCP-based smail systems can add an entry to the /usr/lib/smail/config file that prevents misrouted mail from bouncing around the network until it dies from excess hops. This is controlled by the auth_domains variable, which is used by smail to validate any incoming mail package. When smail receives a message for the local network machine, it checks to see whether the local machine's name is known. If not, the message is returned to the sender.
<BR>
<P>To set an authoritative name validation in the /usr/lib/smail/config file, check for (or add) these lines:
<BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -