COHERENT manpages
This page displays the COHERENT manpage for routers [Rules for resolving mail addresses to remote systems].
List of available manpages
Index
routers -- System Administration Rules for resolving mail addresses to remote systems /usr/lib/mail/routers File /usr/lib/mail/routers defines one or more routers. Each router defines a method by which smail routes mail to a remote system. Each entry within routers names a router and sets its attributes. The order of entries is important, because smail invokes routers in the order in which they appear in this file. Each entry consists of the following information: -> The name of the router. This attribute begins the definition of a router. The name must be unique, it must appear flush with the left margin, and must be followed by a single colon `:'. -> The name of the driver, or program that implements the router. This can be a command that is part of smail's suite of utilities (which are contained in directory /usr/lib/mail), or can be an ordinary COHERENT command. If the latter, then the full name of the command that implements the driver is given with a cmd attribute; this is shown below. -> A set of generic attributes for the router. These attributes are ``generic'' because they can come from a set that can be applied to any router. -> A set of driver-specific attributes. These can be applied only to routers that use this driver. To extend an entry across multiple lines, begin successive lines with white space. For example, the following entry gives the attributes for a director that reads aliases from a file named /private/usr/lib/aliases: # read aliases from a file private to one machine on the network private_aliases: driver=aliasfile, owner=owner-$user ; file=/private/usr/lib/aliases This entry is named private_aliases. It depends upon the low-level director-driver routine named aliasfile, which is built into smail, and which implements a general mechanism for looking up aliases within a data base. By default, the driver aliasfile reads file /usr/lib/mail/aliases (which is simply a file that contains ASCII records in no particular order); this routers tells it instead to read file /private/usr/lib/mail/aliases. (For details on the format of an aliases file, see the Lexicon entry aliases). Finally, this router tells smail that if this director discovers an error while it is processing its input, then it (smail) should sends a mail message to an address formed by prefixing the string ``owner-'' onto the name of the alias. Attributes of a Router The following gives the generic attributes can be used in router entry. Each attribute is followed by its type (Boolean or string). To set a string attribute, its name should be followed by an `=', then the value to which you are setting it. To set a Boolean attribute, prefix it with a `+'; to unset a Boolean attribute, prefix it with a `-'. always (Boolean) A router will not always find a complete match for a particular host name. For example, if a routing data base has a route to the domain amdahl.com but not to the host name futatsu.uts.amdahl.com, then the routing driver might return the route to amdahl.com. In general, smail uses the route that matches the largest ``chunk'' of the target host. However, if you set the attribute always, then smail uses any match found by this router in preference to any route returned by any router that appears below it within routers. This attribute is useful for hard-wiring a certain number of routes within a small data base. For example, this is useful for an Internet site that is the gateway for a small number of UUCP sites within the UUCP zone. driver (string) This attribute gives the set of low-level functions that do the work of routing remote mail. This attribute is required. method (string) transport (string) A router driver can internally set the transport it uses to deliver mail to a remote site. If it does not do so, then you must set either a method or a transport attribute, to specify how the mail is to be delivered. The attribute method names the file whose contents relate host names to transports. The attribute transport specifies a particular transport that is defined in file /usr/lib/mail/transports. If the file named in a method attribute does not contain a match for all hosts, then smail uses the transport named with the transport attribute. The format of a method file is given in the next section. Method Files Method files relates a set of host names with the set of transports to be used to deliver mail to those hosts. Each entry should have the form: hostname transport-name which states that smail should use transport-name to deliver mail to hostname. As a special case, if hostname is the special string `*', the entry matches any host. You should use this catch-all feature only in the last entry in a method file. You can associate an entry in a method file with a particular grade of message. This lets you assign each grade of mail its own transport; for example, you may wish to use non-demand UUCP for messages with a ``bulk'' or ``junk'' precedence. To specify a range of grades, append the range of grade-letters to the host name, separated by `/'. Entries with grades can be in any of the forms: hostname/X transport-name hostname/X-* transport-name hostname/*-Y transport-name hostname/X-Y transport-name For a discussion of grade letters and their correlation with message- precedence strings, see the description of attribute grades in the Lexicon entry for config (smail). In the first form, the transport is used for an exact match of the grade letter. In the second form, a match requires a grade a character value of at least X. In the third, form a match requires a grade character value of at most Y. The final form specifies a range of grades from character value X to character value Y. The Default Configuration The following gives the routers defined in the default version of file /usr/lib/mail/routers that is included with COHERENT. The first router is named paths. It processes the contents of file /usr/lib/mail/paths: # paths - route using a paths file, like that produced by the pathalias program paths: driver=pathalias, # general-use paths router transport=uux; # for matches, deliver over UUCP file=paths, # sorted file containing path info proto=dbm, # use a DBM-style data base optional, # ignore if the file does not exist -required, # no required domains domain=uucp, # strip ending ".uucp" before searching The command pathalias, which this router uses to read file paths, is described in its own Lexicon entry; as is command uux, which this router invokes to transport the files to the remote site. The next router, named uucp_neighbors, matches nearby systems that are accessible via UUCP: # uucp_neighbors - match neighbors accessible over UUCP uucp_neighbors: driver=uuname, # use a program which returns neighbors transport=uux; cmd=/usr/bin/uuname, # specifically, use the uuname program domain=uucp, # strip ending ".uucp" before searching Command uuname is part of the Taylor UUCP package that is included with COHERENT. It is described in its own Lexicon entry. Under COHERENT, this command always returns the name of your local host. The final router describes how to route mail to the ``smart host.'' This is a system that knows how to access more remote systems than your system does, and that you trust to handle mail correctly. smail forwards to the smart host all mail that it does not know how to route, in the hope that the smart host will know what to do with it. # smart_host - a partically specified smarthost director # # If the config file attribute smart_path is defined as a path from the # local host to a remote host, then host names not matched otherwise will # be sent off to the stated remote host. The config file attribute # smart_transport can be used to specify a different transport. # # If the smart_path attribute is not defined, this router is ignored. smart_host: driver=smarthost, # special-case driver transport=uux; # by default deliver over UUCP -path, # use smart_path config file variable? See Also Administering COHERENT, config [smail], directors, mail [overview], smail, transports Notes For information on how the configuration files directors, routers, and transports relate to each other, see the Lexicon entry for directors. Copyright © 1987, 1988 Ronald S. Karr and Landon Curt Noll. Copyright © 1992 Ronald S. Karr. For details on the distribution rights and restrictions associated with this software, see file COPYING, which is included with the source code to the smail system; or type the command: smail -bc.