3. Algorithm
The algorithm for delivering a message to an address "user@domain" over UUCP links can be summarized as follows:
a. If the address is actually of the form @domain1:user@domain2, the "domain" used for the remainder should be "domain1" instead of "domain2", and the bang form reads domain1!domain2!user.
b. Determine d: the most specific part of "domain" that is recognized locally. This part will be a suffix of "domain". This can be done by scanning through a table with entries that go from specific to general, comparing entries with "domain" to see if the entries are at the tail of "domain". For example, with the address "[email protected]", if the local host recognizes "uucp" and "att.com", d would be "att.com". The final entry in the table will be the null string, matching any completely unrecognized domain.
c. Look in the found table entry for g: the name of the "gateway", and for r: a UUCP !-style route to reach g. G is not necessarily directly connected to the local host, but should be viewed as a gateway into the d domain. (The values of g and r for a given d may be different on different hosts, although g will often be the same.)
d. Look at the beginning of r to find the "next hop" host n. N will always be directly connected to the local host.
e. Determine, if possible, the class of g and n.
f. Create an appropriate destination string s to be interpreted by n. (See below.)
g. Pass the message off to n with destination information s.
In an environment with other types of networks that do not use UUCP ! parsing, the table will probably contain additional information, such as which type of link to use. The path information may be replaced in other environments by information specific to the network.
The first entries in the table mentioned in part (b) are normally very specific, and allow well known routes to be constructed directly instead of routing through the domain tree. The domain tree should be reserved for cases where no better information is available, or where traffic is very light, or where the default route is the best available. If a better route is available, that information can be put in the table. If a host has any significant amount of traffic sent to a second host, it is normally expected that the two hosts will set up a direct UUCP link and make an entry in their tables to send mail directly, even if they are in separate domains. Routing tables should be constructed to try to keep paths short and inexpensive for as much traffic as possible.
Here are some hints for the construction of the destination string n (step f above.) The "envelope recipient" information (the argument(s) to rmail) may be in either domain ! form (host.com!user) or domain @ form ([email protected]) as long as the sending site is sure the next hop is class 3. If the next hop is not class 3, or the sending site is not sure, the ! form should be used, if possible, since it is hard to predict what the next hop would do with a hybrid address.
If the gateway is known to be class 3, domain ! form may be used, but if the sending site is not sure, and the entire destination string was matched in the lookup (rather than some parent domain), the 6 letter ! form should be used: r!user, for example: dumbhost!host!user. If the gateway appears to actually be a gateway for a subdomain, e.g. because a parent domain was matched, (such as the address [email protected], where host.gateway.com was not found but gateway.com was) it can be assumed to be at class 3. This allows routes such as dumbhost!domain!host.domain.com!user to be used with a reasonable degree of safety. If a direct link exists to the destination host, the user@domain syntax or the domain!user syntax may be used.
All hosts conforming to this standard are class 3, and all subdomain gateways must be class 3 hosts.