[comp.mail.misc] How to recognize domain literals

moore@betelgeuse.cs.utk.edu (Keith Moore) (12/01/89)

In article <wZRL3aK00VsLA11Y1Z@andrew.cmu.edu>,
	cfe+@andrew.cmu.edu (Craig F. Everhart) writes:
(lamenting the fact that most sendmail sites don't recognize domain literals)
>There's no cure but for the target administrator to fix the 
>sendmail.cf file to recognize explicit dotted-quads, alas, [...]
                               ^^^^^^^^ ^^^^^^^^^^^^

While it's true that many sites running sendmail don't recognize
domain literals, you don't have to hard-code the IP address into
every machine's sendmail.cf file.  The example below shows how.

(somewhere in ruleset zero before you start resolving to mailers)
[...]
#
# If sending to a domain literal, attempt to canonicalize it.
#
R$*<[$+.$+.$+.$+]>$*	$:$1<$[[$2.$3.$4.$5]$]:[$2.$3.$4.$5]>$6
#
# If canonicalization returned our domain name, substitute that
# for the domain literal.  Otherwise leave the domain literal in
# place.
#
R$*<$j:[$-.$-.$-.$-]>$*		$:$1<$j>$6
R$*<$*:[$-.$-.$-.$-]>$*		$:$1<[$3.$4.$5.$6]>$7
[...]
(somewhere below this, your ruleset zero should have a rule that
matches local addresses and sends them to your local mail program.)

This hack assumes that:

1.  $j is the official domain name of your machine.

2.  $[ and $] work properly.

3.  Ruleset 3 puts brackets around the domain to send mail to (before
ruleset 0 sees the address), without including the '@'.  Otherwise,
the above example should be modified to conform to the conventions
used in your existing sendmail.cf file.

(How to fix either (1) or (2) is beyond the scope of this article.)
--
Keith Moore			Internet: moore@cs.utk.edu
University of Tenn. CS Dept.	BITNET: moore@utkvx
107 Ayres Hall, UT Campus	UT Decnet: utkcs::moore
Knoxville Tennessee 37996-1301	Telephone: +1 615 974 0822