📄 lsg36.htm
字号:
<PRE>
<FONT COLOR="#000080"># auth domain name
auth_domains=tpci.com</FONT></PRE>
<P>This code limits the mail messages bouncing around the local network to any valid host name in the domain tpci.com. If the name is not recognized in the local network, it doesn't get circulated. This sometimes can help prevent congestion on a network when large files are misrouted.
<BR>
<BR>
<A NAME="E70E8"></A>
<H5 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Setting the Delivery Mode</B></FONT></CENTER></H5>
<BR>
<P>You can set the smail system to process incoming mail in different ways (other than the daemon or spawned process startup options discussed earlier). You can set smail to store incoming and outgoing messages in a queue and process them at later times, or to process mail immediately. This process is controlled with the queue_only and delivery_mode variables.
<BR>
<P>The queue_only variable is a Boolean value that, if set, enables the delivery_mode variable, which can be set to one of three values:
<BR>
<TABLE BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 >
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
foreground
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Processes incoming messages immediately</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
background
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
The message is delivered by a child process</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
queued
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Holds the message for later processing</FONT>
</TABLE><P>When queuing is enabled, messages are held in a smail queue (usually in /var/spool/smail/messages) until the queue is processed. The processing is controlled by the -q option on the smail command line (if smail is started as a daemon), or by issuing the command runq from a crontab file (if smail is run from inetd). (For the latter to work properly, runq must be linked to smail).
<BR>
<P>Recall the startup command line from the rc file shown earlier:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">/usr/local/bin/smail -bd -q15m</FONT></PRE>
<P>You remember that the queue is processed every 15 minutes in this example. The queue process command can be set to any value, but it should not be left for too long as the queue files can get very large.
<BR>
<P>You can display the current contents of the smail queue by issuing the smail command with the -bp option or with the command mailq, which should be linked to smail.
<BR>
<BR>
<A NAME="E70E9"></A>
<H5 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Setting the Postmaster</B></FONT></CENTER></H5>
<BR>
<P>Every network should have a postmaster, which is a user who receives all the status messages from the mail systems as well as queries from other networks about the local area network and its users. By default, the postmaster ID is set to root, although you can override it with the command like this in the /usr/lib/smail/config file:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">postmaster=tparker</FONT></PRE>
<P>This command routes all messages for the postmaster to the user tparker. You only need to specify this option in the /usr/lib/smail/config file if you want to change the default setting of root.
<BR>
<P>You can configure the postmaster to receive all error messages that are generated because of configuration errors. Add the Boolean variable to the /usr/lib/smail/config file:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">+error_copy_postmaster</FONT></PRE>
<P>If this entry doesn't exist with a plus sign ahead of it, messages are not copied to the postmaster.
<BR>
<BR>
<A NAME="E69E235"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Debugging smail</B></FONT></CENTER></H4>
<BR>
<P>In normal operation, smail uses two log files to record actions. Most transactions are recorded in the file /var/spool/smail/log/logfile (your path may differ, depending on the version of Linux). Each entry in the log reflects a complete smail transaction and includes the identification number of the message, sender, recipient, times, size, and routing information. You can use the contents of the log file to check for proper behavior of the smail system.
<BR>
<P>Errors and other problems are recorded in the file paniclog (usually /var/spool/smail/log/paniclog). An entry in this file tends to show the basic information about a message as well as the reason the message couldn't be sent. For example, the most common error is a failure to route a message through SMTP, which produces the log summary:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080"> (ERR_148) transport smtp: connect: Connection refused</FONT></PRE>
<P>If you see these error messages in the paniclog file, it usually means SMTP has failed, the connection is not responding because the remote host is down, or the TCP service is not enabled (check /etc/services).
<BR>
<P>If the entries in the paniclog file don't help you isolate a problem, you can enable a debugging mode on smail by adding the option -d followed by a number to the startup command. The number reflects the amount of debugging information to be generated and displayed on the screen. It is best to kill the smail daemon (if one is being used) and restart it at a shell prompt with this option active, instead of embedding the debug option in the rc file.
<BR>
<P>If you are not getting any mail forwarded to your mailbox, check the pathnames of the mailbox files. Usually, mailboxes are stored in /usr/spool/mail/username where username is each user's mailbox. Some versions of Linux use /var/spool/mail instead, and some mail applications may be expecting a specific address for the mailbox. If you are not sure whether the mailbox location is correct, try creating links between /usr/spool/mail/username and /var/spool/mail/username.
<BR>
<BR>
<A NAME="E68E200"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B> Modifying smail's Behavior</B></FONT></CENTER></H3>
<BR>
<P>The configuration files and processes mentioned earlier apply for most Linux systems, and many systems will require no further actions than those already covered. However, as mentioned earlier in this chapter, smail's three components (router, director, and transport) can each be further configured to modify their behavior. This capabilty can help you fine-tune or modify your smail installation to meet particular network needs. The only component you really need to examine in detail is the router, as the director and transport seldom need customization for a typical Linux installation.
<BR>
<P>In most cases, the behavior of each smail component is handled by a file (or several files) based in the smail configuration directory (usually /usr/lib/smail). Many sample configuration files are available from Linux distribution CD-ROMs and FTP sites that show different configurations. Obtaining one of these sample files, and then modifying it for your host-specific details, is easier than building the files from scratch. The number of options and details change with the release of smail, so check to see whether you have a complete version.
<BR>
<P>The router component of smail handles the resolution of destination addresses, routing to the next mail host for further forwarding, and determination of which transport should be used to send the message on. The router component performs a number of tasks, first determining if the message is for a local or remote machine (using the variable values defined in /usr/lib/smail/config). If the message is for a local machine, the message is handed off to the director.
<BR>
<P>If the message is for a remote machine, the message's address is given to router drivers to determine which host the message should be forwarded to. The router drivers are specified in the file routers (usually /usr/lib/smail/routers). The file contains the names of the router drivers, each of which (in the order presented in the routers file) is given the message destination address to see if they have information about the specific route required to send the message.
<BR>
<P>You don't need to specify any other routers than the default configuration in most cases. The default setup uses the following router steps, in order:
<BR>
<UL>
<LI>Resolution directly by dotted quad IP address using gethostbyaddr library call
<BR>
<BR>
<LI>Resolution by symbolic name using gethostbyname library calls
<BR>
<BR>
<LI>Resolution using the pathalias database (given in the file /usr/lib/smail/paths—see below)
<BR>
<BR>
<LI>For UUCP addresses, resolution to see whether the destination is a UUCP neighbor
<BR>
<BR>
<LI>Routing to a smart host, if one exists, when other methods to resolve the name have failed
<BR>
<BR>
</UL>
<P>These default routings work for most systems, although you should comment out the UUCP router if your system is not properly configured to handle UUCP. Otherwise, you will get tons of error messages. If you do not plan to use UUCP for mail, you should also comment out this router line to simplify the entire smail system.
<BR>
<P>A couple of other common situations need to be dealt with. If you are connected to the Internet, there is a problem in that smail's router doesn't recognize the MX record format. In order to properly support Internet mail, comment out the default router and enable the BIND router instead. (If your version of Linux doesn't support BIND, you can obtain and link a more recent version from FTP and BBS sites.)
<BR>
<P>If you are using both SLIP/PPP and UUCP connections, you may encounter problems with smail waiting too long for a connection. To simplify this type of installation, rearrange the order the routers are checked so that the paths file is checked before the resolver router. In many cases, because UUCP is more efficient and faster than SMTP over a SLIP/PPP line, you can disable the resolver-based router entirely.
<BR>
<P>When a router identifies the best route to the destination machine, it also gives the transport required to communicate with that machine's mail router. The actual path to the destination may be modified at this point. For example, if the remote machine chatton@bigcat.com can best be reached through a UUCP link instead of SMTP, the destination address may be modified by the router to bigcat!chatton (UUCP-style addressing). Alternatively, a destination address may become more specific. For example, the address chatton@bigcat.com may be resolved to a specific machine such as chatton@whiskers.bigcat.com, if that address will get the message delivered more efficiently.
<BR>
<P>Some UUCP routers use the /usr/lib/smail/paths file is used by to determine a path alias. The paths file is ASCII only and contains a sorted list of entries with two columns separated by a tab: the destination site name and its UUCP<A NAME="I2"></A> bang path. No comments are allowed in the file.
<BR>
<BR>
<A NAME="E68E201"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Summary</B></FONT></CENTER></H3>
<BR>
<P>This chapter has looked at the configuration of the smail mail system for UUCP and TCP-based mail connections. In either case, the configuration process is usually a matter of modifying a single file, unless you have several different connections to the outside world. It is the simplicity of configuration that makes smail popular with Linux users.
<P ALIGN=LEFT>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -