home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Previous Section Next Section

FEATURE(nocanonify)

Don't canonify with $[ and $] V8.1 and above

Ordinarily, sendmail tries to canonify (add a domain to) any hostname that lacks a domain part, and to canonify (ensure a correctly formed domain) for any host with a domain. It does this by passing the unadorned hostname to the $[ and $] operators (Section 18.7.6). The nocanonify feature prevents sendmail from passing addresses to $[ and $] for canonicalization. This is generally suitable for use by sites that act only as mail gateways or that have MUAs that do full canonicalization themselves.

The form for the nocanonify feature is:

FEATURE(`nocanonify')

If you only want hostnames without a domain part canonicalized, you can add a second argument like this:

FEATURE(`nocanonify', `canonify_hosts')

Note that the nocanonify feature disables only one possible use of $[ and $] in the configuration file. If the pre-V8.9 nouucp feature is omitted (thereby including UUCP support), addresses that end in a .UUCP suffix still have the preceding part of the address canonified with $[ and $] even if the nocanonify feature was declared.

Also note that the Modifiers=C equate (See this section) for the DaemonPortOptions option does the same thing as this nocanonify feature, but does so on a port-by-port basis.

Sending out any unqualified addresses can pose a risk. To illustrate, consider a header where the local host is here.us.edu:

To: hans@here.us.edu
Cc: jane@here, george@fbi.us.gov
From: you@here.us.edu

The assumption here is that this will go to the local hub machine for delivery, and that the hub will view jane as a local user and perform local delivery.

But consider a hub that has two MX records (a rather small number). One points to itself so that it always gets mail first. The other points to a host at another host, off campus. If the hub is down but its clients are up, mail will be delivered to the other campus machine on the assumption that it will hold the mail until the hub returns to service. The problem is that the address jane@here is unqualified (incomplete) when it gets to the other campus machine, and will bounce because a host in jane@here is unknown.

Beginning with V8.10 sendmail, you can list domains that you want canonified, even though you have enabled this feature. You add those domains to a special sendmail class using either of two new macros:

CANONIFY_DOMAIN(`list of domains')
CANONIFY_DOMAIN_FILE(`/path')

The first form causes the list of domains to be added to your configuration file using the C configuration command. The second causes the file indicated by /path to be read (using the F configuration command) for a list of domains. For example, to require that the local domain be always canonified you can use a declaration such as this:

CANONIFY_DOMAIN(`$=m')

Subdomains (such as sub.your.domain) will be matched when you list just the domain (your.domain). Therefore, it is only necessary to list top-level domains to have a domain and its subdomains canonicalized.

    Previous Section Next Section