[comp.mail.sendmail] Can sendmail rewrite a!b.c!d!e.f!g as e.f!g?

moore@betelgeuse.cs.utk.edu (Keith Moore) (11/03/89)

In article <43@looney.twinsun.com> eggert@twinsun.com (Paul Eggert) writes:
>We're a UUCP site connected to the Internet via MX forwarding.  We often get
>mail with addresses that have long combinations of domain names and UUCP names
>separated by !, e.g. something like:
>
>	ucla-cs!usc!cs.utexas.edu!purdue!tut.cis.ohio-state.edu!dec!olsen
>
>typically in response to Usenet postings.  Is it OK to remove all leading
>components of such a path up to the last component that is a domain name, e.g.
>rewrite the above as the following?
>
>	tut.cis.ohio-state.edu!dec!olsen
>
This isn't a good idea, because (a) the legal syntax for UUCP addresses is
rather limited, and (b) the email world is bigger than just Internet or UUCP.

Hypothetical example:

Say someone on our DECnet sends a piece of mail through cs.utk.edu 
(utkcs in the UUCP world) to a UUCP site.  The return address would look 
something like ...!utkcs!foo.decnet!user .  Now, foo.decnet is not an Internet
domain, but it looks like one to sendmail rewrite rules.  (One could argue
that the address should be ...!cs.utk.edu!foo.decnet!user instead, but
the former seems more consistent with UUCP syntax, and therefore hopefully
more compatible with mail software in the UUCP world.)

Now of course it would be much better if cs.utk.edu had used foo.decnet's 
domain name instead, and our DECnet gateways do this if the decnet node
actually has a domain name.  However, many of the machines connected to
our DECnet are not under our administrative control, and we are not at
liberty to assign domain names for them.  (A "trapdoor" MX record for
every machine in our DECnet is a possibility, but still under discussion.)

The point is, with mail systems which use relative addressing such as UUCP
(or DECnet mail, for that matter), each node in the path is free to interpret
the next hop in the address however it chooses.  Normally this is handled
consistently from one node to another, but special hacks for gatewayed
mail are all too common.   Such hacks depend on the notion that any replies
or error messages should traverse the inverse path that the original message
took.  In networks with relative addressing, this is a reasonable assumption.
(For robustness, error messages should *always* take the inverse path of
the original message, RFC1123 notwithstanding.)

Back to the question of short-circuit routing within sendmail.  It might
be reasonable to short-circuit a UUCP-style route to a domain if one
were certain that the domain was in the nameservers with either an A
or an MX record.  But even this can cause problems, because the mail
exchanger for foo.bar might rewrite mail destined for user@foo.bar as
path!to!foo!dot!bar!foo.bar!user.  If one of the intervening nodes
tried to short-circuit the path back to foo.bar!user, the mail would
get in a loop between that node and foo.bar's mail exchanger.

So in general it seems wisest not to rewrite UUCP paths for reasons
of efficiency.

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

lear@GENBANK.BIO.NET (Eliot Lear) (11/12/89)

The solution to Keith Moore's objection to short circuiting is to
keep a list of valid top level domains, and only short circuit on
those.
-- 
Eliot Lear
[lear@net.bio.net]