Send in your Unix questions today! |
See additional Unix tips and tricks
Before sendmail 8.13, sendmail servers were generally set up in one of two ways. Either their configurations were based on the main.cf file and they used DNS MX records to determine the identities (and IP addresses) of hosts to which mail was to be delivered or their configuration was based on the subsidiary.cf file and they were set up to relay mail through a system with more knowledge of the outside world (in particular, access to a real world DNS server) than systems requiring the relay service.
These two basic configurations have basically merged in version 18.13 of the sendmail software with the addition of a new configuration option -- the FallbackSmartHost. Designed to be a last ditch option for relaying mail, a FallbackSmartHost is used only if all higher preference options are unavailable. The list of higher preference options can include a SmartHost setting as well as a list of servers identified through their MX records. Once all these other options have been exhausted, either because no systems were identified or they were not available to accept the current mail messages, sendmail will attempt to deliver the email to the FallbackSmartHost.
A message intended for someone with a sun.com email address, for example, might be sent to any of five defined mail exchangers. As defined in DNS, the following systems provide this service for the sun.com domain:
sun.com preference = 20, mail exchanger = mx3.sun.com
sun.com preference = 5, mail exchanger = btmx1.sun.com
sun.com preference = 5, mail exchanger = btmx3.sun.com
sun.com preference = 5, mail exchanger = btmx4.sun.com
sun.com preference = 20, mail exchanger = mx4.sun.com
Since three of these systems have a preference of 5 (higher priority) and two have a preference of 20 (lower priority), the chances are that your message will be sent to one of the three "btmx*" servers. Each has an equal likelihood of being used. If, for some reason, none of these systems responds, the two lower priority servers will be tried. If none of the five servers responds, the FallBackSmartHost is used. In short, it acts like a lowest possible preference MX server.
A FallBackSmartHost can be configured in the sendmail.mc file in much the same manner as the SmartHost. Where the SmartHost is set up with a line that looks more or less like this:
define(`SMART_HOST',`outside.facing.host')
in which "outside.facing.host" is, of course, replaced with the fully qualified name of the actual server, the FallBackSmartHost requires a line like this:
define(`confFALLBACK_SMARTHOST',`another.smart.host')
Both the SmartHost and the FallbackSmartHost server are termed "smart" because they are able to query DNS to acquire the information needed to send mail to systems outside the organization.
Since MX lookups and the use of smart hosts are compatible, you can use the same sendmail.cf file whether you expect to be relaying to a smart host or making use of MX records. In addition, the availability of the FallbackSmartHost options allows you to configure a smart host that can serve as a secondary smart host if your primary smart host (the one defined with your SmartHost option) is unavailable.