smail(8) —
NAME
smail, rmail − UUCP mailer with routing
SYNOPSIS
smail [ options ] address ...
rmail [ options ] address ...
DESCRIPTION
The smail/rmail program replaces /bin/rmail (rmail(1)) to become the UUCP mail transport mechanism. They are links to the same executable. rmail receives mail from UUCP; smail introduces mail into UUCP.
smail/rmail can work with or without sendmail(8) or another intelligent mail system. For hosts with only /bin/mail (mail(1)), smail/rmail subsumes some of the functions of sendmail, and hands only local mail to /bin/mail. For hosts with sendmail, smail/rmail can act as UUCP frontends and backends to sendmail, allowing sendmail to process all mail through the host. As distributed, bang mail that is not bound for a local recipient will be passed directly to uux without calling sendmail.
To varying degrees, smail/rmail automatically routes the addresses it processes. smail/rmail most often routes domain-style addresses (i.e., user@domain), producing a UUCP path (i.e., host!address) or a local address (i.e., user), but it can also reroute explicit UUCP paths.
Options
−A Print the resolved addresses. Do not collect a message or invoke a mailer.
−d Be verbose and do not invoke other mailers.
−v Be verbose, but still invoke other mailers.
−h hostname
Set hostname. The default is configuration dependent, but it is usually provided by a system call such as gethostname(2) or uname(2).
−H hostdomain
Set hostdomain. The default is configuration dependent.
−F address
Use address on the “From:” line in locally generated mail.
−p pathfile
Set path database file name if it is not /usr/lib/uucp/paths.
−a aliasfile
For sites without sendmail, set alias database file name if not in the place defined at compile time (see ALIAS in /etc/default/smail). This is usually /usr/lib/aliases.
−n namelist
smail supports another type of aliasing intended for full name resolution using a sorted file called namelist which contains name/address pairs. This allows mail to George.P.Burdell@gatech.edu to be delivered correctly. These aliases are very simple since they are not composed of long lists of recipients for each alias. They are also numerous, because mail to George.P.Burdell may be addressed to Burdell, G.Burdell, George.Burdell, P.Burdell, G.P.Burdell, or George.P.Burdell. This simpler form of aliasing uses the same fast searching algorithm that is used for the paths file, so it keeps resolution time manageable.
−q number
Take number as the queueing threshold. When routing mail (−r, −R, or domain addressed mail) to a given host, if the cost listed in the paths file is less than the queueing threshold, then the mail will be sent immediately. This overrides the default threshold (see QUEUECOST in /etc/default/smail) of DEDICATED+LOW.
−m number
At most, number jobs will be handed to uux for immediate delivery by a single invocation of smail (see MAXNOQUEUE in /etc/default/smail).
−u uuxflags
Use uuxflags as the flags passed to uux for remote mail. This overrides any of the default values and other queueing strategies.
-c Consult the paths file for the cost of the path even when not routing the mail. This makes it possible to use the cost information when sending pure UUCP path mail without rerouting it.
−r Route the first component of a UUCP path (host!address) in addition to routing domain addresses (user@domain).
−R Reroute UUCP paths, trying successively larger right-hand substrings of a path until a component is recognized.
−l Instead of routing a domain address, send it to the local mailer for processing. Normally, only local addresses go to the local mailer.
−L Send all addresses to the local mailer for processing, including UUCP paths.
Most of the flags are also compile time options, since uux does not normally invoke rmail with the desired flags. smail resets any preset −l or −L flags. The −l flag causes rmail to send all domain addresses through the local mailer, to process addresses for non-UUCP domains. The −L flag causes rmail to send even explicit UUCP paths through the local mailer, presumably to make use of other transport mechanisms. In both cases, rmail defers any routing until smail assumes control of it.
Configuration
The configuration of the smail program can be changed by editing the file /etc/default/smail. Remove the comment character (#) in front of the option that you want to change and enter the new value after the equal sign (=). The configurable options and their defaults are listed below.
HOSTNAME The literal name of this host. If defined, HOSTNAME is used instead of calling uname() to determine the local hostname.
MYDOM .uucp
The literal domain suffix for this host. The suffix .uucp here is used only for testing; you should use a site name that has been registered with COM, EDU, etc.
HOSTDOMAIN Defining this overrides the default HOSTNAME.MYDOM.
DOMGATE no
Act as a Domain Gateway. If defined, DOMGATE (DOMain GATEway) will cause addresses of the form:
user@MYDOM or MYDOM!user
(with and without the leading dot (.) on MYDOM) to be treated simply as user − a purely local address. Then, it is left to the aliasing code to map it back to a non-local address if necessary.
HIDDENHOSTS no
Hide subdomains of hostdomain. Allows hosts that serve as domain gateways to hide the subdomains beneath them. Mail that originates at any of the hosts in the subdomain will appear to come from the gateway host. Thus, mail from
anything.hostdomain!user
will appear to come from
hostdomain!user
A consequence of this is that return mail to hostdomain!user would need to be forwarded to the proper subdomain via aliases or other forwarding facilities. If you are using sendmail, if HIDDENHOSTS is defined here, it should be used in ruleset 4 of the sendmail.cf, too.
SMARTHOST smart-host
pathalias alias for relay host. Mail that would otherwise be undeliverable will be passed to the aliased SMARTHOST for potential delivery. It is important to receive prior approval to use the host you specify in your pathalias input as a relay. If you are using foovax as your relay, and you define SMARTHOST as smart-host, then the pathalias alias would be:
smart-host = foovax
FULLNAME Full name and address pairs. Defining FULLNAME means that Full Name resolution will be attempted when necessary. The Full Name information will be taken from a list of {Full Name, address} pairs. The names in the list must be sorted without regard to uppercase/lowercase; all full name searches are case insensitive.
PATHS /usr/lib/uucp/paths
The name of the pathalias database file.
LOG Log file of UUCP mail addresses. Define LOG if you want a log of mail. This can be handy for debugging and traffic analysis.
RECORD Record file of UUCP mail. Define RECORD in order to get a copy of all mail sent. This uses a great deal of time and space, so it is only used for extreme debugging cases.
DEFQUEUE yes
Queue uux mail instead of sending it immediately.
QUEUECOST 100
Remote mail with a cost of less than QUEUECOST will be handed to uux for immediate delivery.
Addresses
smail/rmail understands user@domain to be a domain address, host!address to be a UUCP path, and anything else to be a local address.
Because some versions of rmail unpredictably interpret mixed UUCP/domain addresses, smail/rmail understands domain!user to be a domain address, and generates path!domain!user when mailing to a cognate smail/rmail host. To distinguish domain domain!user from UUCP host!address, domain contains at least one (1) dot. Unlike the old versions of /bin/rmail, smail/rmail gives precedence to @ over ! when parsing mixed addresses. Thus, a!b@c is parsed as (a!b)@c, rather than a!(b@c).
Routing
Because smail/rmail is the UUCP transport mechanism, it can only effect delivery on UUCP paths and local addresses; domain addresses require resolution into UUCP paths or local addresses. To resolve a domain address, smail/rmail finds a route to the most specific part of the domain specification listed in the routing table. Two degrees of resolution can occur:
Full resolution:
smail/rmail finds a route for the entire domain specification, and tacks the user specification onto the end of the UUCP path. The address can also fully resolve to a local address (the UUCP path is null).
Partial resolution:
smail/rmail finds a route for only the right-hand part of the domain specification, so it tacks the complete address (in the form domain!user) onto the end of the UUCP path. Since this syntax is not widely understood, UUCP gateways listed in the path database must install new UUCP software, either smail/rmail or new sendmail configuration files (or both).
It is an error if a partially resolved address routes to the local host (a null UUCP path), since according to the routing table, the local host is responsible for resolving the address more fully.
The −r flag causes smail/rmail to attempt to route only the first component of a UUCP path. If this fails, it passes the unrouted address to uux, in case the path database is not complete. The −R flag causes smail/rmail to take a UUCP path and route the rightmost component of the path (save the user name) possible. This is mostly for hosts that have very up-to-date routing tables.
If a route cannot be discerned from the available routing database, then one more attempt to route the mail is made by searching for an entry in the database for a route to a smart-host. If this entry exists, then the mail will be forwarded along that route to be delivered. This allows a host to depend on another (presumably better informed) host for delivering its mail. This kind of arrangement should be made in advance with the smart-host’s system administrator.
After smail/rmail resolves an address, it reparses it to see if it is now a UUCP path or local address. If the new address turns out to be another domain address, smail complains because a domain name should always resolve to either a UUCP path or the local host.
By default, smail will not alter the explicit bang path routing of any mail message. If the stated path is unusable (i.e., the next hop host is unknown), then smail will apply ALWAYS routing, and attempt to deliver the mail to the potentially new address. If this fails too, then REROUTE routing will be applied to the address, and another attempt to deliver is made. Lastly, an attempt to find a path to a better informed host smart-host will be made and the mail passed to that host.
From Lines
smail/rmail collapses “From” and “>From” lines to generate a simple from argument which it can pass to sendmail or use to create its own “From” line. The rule for “fromming” is concatenate each “remote from” host (separating them by !’s), and tack on the address on the last “From” line; if that address is in user@domain format, rewrite it as domain!user; ignore host or domain if either is simply the local hostname. It also removes redundant information from the “From” line. For instance:
...!myhost!myhost.mydomain!...
becomes:
...!myhost!...
Leading occurrences of the local host name are elided as well.
smail/rmail generates it own “From” line, unless it is feeding sendmail, which accepts the −ffrom argument. For UUCP bound mail, smail/rmail generates a “remote from hostname,” where hostname is the UUCP hostname (not the domain name), so that “From” can indicate a valid UUCP path, leaving the sender’s domain address in “From:.”
Headers
Certain headers (“To:,” “From:,” “Date,” etc.) are required by RFC822. If these headers are absent in locally generated mail, they will be inserted by smail. Also, a line of trace information, called a “Received:” line, will be inserted at the top of each message.
Undeliverable Mail"
Although nobody likes to have a mail message fail to reach its intended destination, it sometimes happens that way. Mail that is found to be undeliverable (i.e., unknown user or unknown host) will be returned to the sender.
FILES
/usr/lib/uucp/paths
ASCII path database
/usr/lib/aliases ASCII alias database
/usr/spool/uucp/mail.log
log of mail
/tmp/mail.log record of mail
SEE ALSO
mail(1), uucp(1), uux(1C), sendmail(8).
aliases(5), paths(5) in the INTERACTIVE SDS Guide and Programmer’s Reference Manual.
\*U — Version 1.0