The mailertable defines special treatment for specific hosts or domains based on the remote host or network name. It is frequently used on Internet sites to select an intermediate mail relay host or gateway to reach a remote network through, and to specify a particular protocol (UUCP or SMTP) to be used. UUCP sites will generally not need to use this file.
Order is important. Sendmail reads the file top-down and processes the message according to the first rule it matches. So it is generally wise to place the most explicit rules at the top of the file and the more generic rules below.
Suppose you want to forward all mail for the Computer Science department at Groucho Marx University via UUCP to a relay host ada. To do so, you would have a mailertable entry that looked like the following:
Suppose you want all mail to the larger groucho.edu domain to go to a different relayhost bighub for address resolution and delivery. The expanded mailertable entries would look quite similar.
As mentioned above, order is important. Reversing the order of the two rules shown above will result in all mail to .cs.groucho.edu going through the more generic bighub path instead of the explicit ada path that is really desired.
In the mailertable examples above, the UUCP-A mailer makes sendmail use UUCP delivery with domainized headers.
The comma between the mailer and remote system tells it to forward the message to ada for address resolution and delivery.
Mailertable entries are of the format:
There are a number of possible mailers. The differences are generally in how they treat addresses. Typical mailers are TCP-A (TCP/IP with Internet-style addresses), TCP-U (TCP/IP with UUCP-style addresses), and UUCP-A (UUCP with Internet-style addresses).
The character that separates the mailer from the host portion on the left-hand-side of a mailertable line defines how the address is modified by the mailertable. The important thing to realize is that this only rewrites the envelope (to get the mail into the remote system). Rewriting anything other than the envelope is generally frowned upon due to the high probability of breaking the mail configuration.