-->
Previous Table of Contents Next


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, you should modify the /etc/inetd.conf file to contain an entry like this:


smtp  stream  tcp  nowait  root  /usr/sbin/smtpd   smtpd

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

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. We can look at each of the configuration processes separately. You can follow both, if you allow mail through both methods.

Configuring smail for UUCP

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 such as config.sample in the same directory. You can use either as a template for the UUCP modifications.

Use any ASCII editor to edit /usr/lib/smail/config (the path in your distribution may be different). There are four changes you need to make. The changes are for these variables:

  visible_domain The domain names your site belongs to
  visible_name Your site’s full domain name
  uucp_name Your site’s UUCP-based name (usually the same as visible_name)
  smart_host The name of the UUCP host

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 equals sign on any line. Comments in the file are preceded by a pound sign.

Setting the Local Domain Names

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 usually looks similar to this:


# Our domain name

visible_domain=tpci

The visible_domain 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 smail to find out whether 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.

If there is more than one valid value for a local domain name, the values are separated by colons, as shown in this example:


visible_domain=tpci:tpci.com:tpci.UUCP

If your site is properly registered on UUCP maps, add the domain “uucp” to the list of valid values, as well. In this example, we belong to the domain tpci (from the full domain name tpci.com) and uucp:


visible_domain=tpci:tpci.com:uucp

You may have several variations of the local domain name on the visible_domain line to account for typographic errors, if you want.

Setting the Local Domain for Outgoing Mail

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 will look something like this:


# Our domain name for outgoing mail

visible_name=tpci.com

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.

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.

Alternate UUCP Names

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. The uucp_name variable can be used to correct this change, without requiring updates to the UUCP mapping tables.

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:


# UUCP mapping name

uucp_name=tpci.com

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.

Setting a UUCP Smart Host

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 /usr/lib/smail/config file next to the variable smart_host. Look for entries in the file that resemble these lines:


# Smart host

smart_host=merlin

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 Chapter 39, “UUCP,” for more information.)


Previous Table of Contents Next