The domain table consists of at least two columns of information: the first (leftmost) column lists the host name to be matched, and the second column lists the host name of final destination. Either tabs or spaces separate the columns. Additional columns indicate names of one or more forwarding machines (machines through which mail should be routed for delivery to the host in the second column). It is recommended that you use the interface offered in the Mail Manager to edit the domain table map file. See ``Managing the domain table'' for more details.
The syntax of the domain table file is a simple key/value pairing. The key is the hostname to be looked up in the domain table (the first column). The value includes all names on the rest of the line.
For example, consider the following domain table file line:
mach1 x.y.z.comIn this example, the host name to be matched is mach1, and the mail will be sent to x.y.z.com. Consider an address such as user@mach1. The host name of the address, mach1, will be looked up in the domain table. A match is found with the above file entry, and the address will be re-written as user@x.y.z.com.
The domain table also supports subdomain matches. This enables you to map all hostnames with a common subdomain to a specified host name or route. This is accomplished within the domain table by prefixing the domain name, the key of the entry, with a ``.''.
For example, consider the following domain table file entry:
.myco.com x.y.z.comIn this example, any host name which has a subdomain myco.com will match this entry in the domain table. For example, host names mach1.myco.com, and mach2.subnet.myco.com will match this entry. However, a subdomain match converts the address into a source route. The address user@mach1.myco.com will be rewritten as follows:
@x.y.z.com : user@mach1.myco.comSource routes are also generated by creating a domain table entry with additional columns which specify the route to the final host. For example, consider the following domain table file entry:
a.b.com x.y.z.com hop1.y.z.comIn this example, an address such as user@a.b.com will be re-written as follows:
@hop1.y.z.com: user@x.y.z.comThe effect is that mail addressed to a.b.com will be sent to x.y.z.com, via the machine hop1.y.z.com.
To illustrate another example of subdomain matching, suppose you wanted all mail from the domain b.com to be first relayed to hop1.y.z.com, then to x.y.z.com. Then the previous table file entry would appear as
.b.com x.y.z.com hop1.y.z.comNotice again the ``.'' prefixed to the key of the entry. Suppose mail is sent to user@mach1.b.com. The subdomain match rewrites this address as
@hop1.y.z.com, @x.y.x.com : user@mach1.b.comIt should be noted that all of the previous examples assumed that the delivery agent uses Internet style addressing. The form of the address is dependent upon the delivery mechanism. If UUCP were used to deliver the mail, the route would be specified as a !-path instead.