[comp.mail.uucp] Treatment of envelope recipient addresses

duncan@comp.vuw.ac.nz (Duncan McEwan) (09/02/88)

In article <4740@b-tech.UUCP> zeeff@b-tech.UUCP (Jon Zeeff) writes:
>Perhaps all this discussion can result in some conclusions on a 
>few basic questions.

Excellent idea, Jon!

>Mail your results to me.

I've just done that - I wonder what the chances of them reaching you
are :-)

> Additional questions are welcome.

One question that I have not seen much discussion on is what should
a UUCP <-> Internet gateway do with an "!" format route in the envelope
recipient address.  Here is what I think should happen.

If someone sends to "user%somesite@internet.edu" from a non-internet UUCP site,
that site should leave the recipient address untouched in the "To:" header,
but rewrite the recipient envelope as "edu-gateway!internet.edu!somesite!user".

When "edu-gateway" gets it the address will be "internet.edu!somesite!user"
Once they have figured out that they are sending to internet.edu via SMTP over
the Internet, they should convert the uucp route address to the Internet
equivelent - ie "@internet.edu:user@somesite" (or if they follow rfc822 to the
letter and don't allow unregistered sites as part of route addresses, perhaps
"user%somesite@internet.edu").  In "sendmail" terminology, this would be
done in the smtp mailer specific recipient ruleset.

The current behaviour of many UUCP <-> Internet gateways seems to be
to make "internet.edu!somesite!user" into "somesite!user@internet.edu",
Assuming it at least handles "@" before "!", the mail will at least get
to "internet.edu", but may or may not be interpreted correctly there,
depending on if internet.edu knows about uucp style addressing.

The site that originally converted "user%somesite@internet.edu" into the pure
uucp path could have made the recipient envelope into
"edu-gateway!internet.edu!user%somesite", but this is somewhat dangerous since
the path to edu-gateway could pass through a site that treated "%" with higher
precedence than "!". 

I think the behaviour I have described is practical to implement in sendmail
(I don't know if this is true of other mailers like mmdf, or if they already
behave in this way).  Have I missed something that makes it difficult?  Are
there any UUCP <-> Internet gateways using sendmail that do behave this way? 

Duncan  (duncan@comp.vuw.ac.nz, ...!uunet!vuwcomp!duncan)

dudek@frapray.ksr.com (Glen Dudek) (09/04/88)

In article <14177@comp.vuw.ac.nz> duncan@comp.vuw.ac.nz (Duncan McEwan) writes:
>
>When "edu-gateway" gets it the address will be "internet.edu!somesite!user"
>Once they have figured out that they are sending to internet.edu via SMTP over
>the Internet, they should convert the uucp route address to the Internet
>equivelent - ie "@internet.edu:user@somesite" (or if they follow rfc822 to the
>letter and don't allow unregistered sites as part of route addresses, perhaps
>"user%somesite@internet.edu").

I configured Harvard's sendmail.cf to create a route-addr style address
if 'somesite' was a domain-style sitename.

>
>The current behaviour of many UUCP <-> Internet gateways seems to be
>to make "internet.edu!somesite!user" into "somesite!user@internet.edu",

This is what Harvard's sendmail.cf does if 'somesite' is not domainized
(or is pseudo-domainized, as in 'somesite.UUCP').

>I think the behaviour I have described is practical to implement in sendmail
>(I don't know if this is true of other mailers like mmdf, or if they already
>behave in this way).  Have I missed something that makes it difficult?  Are
>there any UUCP <-> Internet gateways using sendmail that do behave this way? 
>

The rest of this is for you sendmail guru's out there who care.

Here are the relevant sections from Harvard's sendmail.cf...
NOTE that this is the way I left it in summer 1987 - it may have been
improved.

This code translates Internet route-addrs from '@a,@b:user@c' into
'user@c@b@a' in Ruleset 3.

    # handle route-addr (ARPA routing syntax)
    # in general, change @a,@b:user@c <=> user@c@b@a
    # prepare to focus
    #
    # KLUDGE - strip stupid uucp path from front of route-addrs - gd 8/6/87
    #  foo!@bar:user@gag <=> @bar:user@gag
    R$+!@$+:$+@$+		$:@$2:$3@$4
    # recognize route-addr
    R@$+			$:@$1<>
    # change @b,@c:user@d<@a> <=> @c:user@d<@b@a>
    R@$+,@$+:$+<$*>		@$2:$3<@$1$4>
    # change @a:user@b <=> user@b<@a>
    R@$+:$+<$*>			$2<@$1$3>
    # defocus, and treat as simple 'user@site' below
    R$+<$*>			$1$2

This code translates UUCP addresses directed at Internet hosts from
'foo.domain!uucp-host!user@internet.domain' into
'uucp-host!user@foo.domain@internet.domain'.

    #################################
    #  UUCP -> ARPA route-addr	#
    #################################
    S9
    # focus on first uucp address
    R$+!$+@$+			$:<!$1>$2@$3
    # if the first bang-host is arpa-style, turn it into an '@'
    R<!$+.$=A>$+@$+		$@$>9$3@$1.$2@$4
    # else simply return as mixed-mode
    R<!$+>$+@$+			$@$1!$2@$3

This code is from Ruleset 4, and invokes Ruleset 9 and then converts
addresses with multiple '@'s (e.g., 'foo!user@c@b@a') into Internet
route-addr syntax (e.g., '@a,@b:foo!user@c').

    # change mixed-mode '@' and '!' into route-addr if appropriate
    R$+!$+@$+			$:$>9$1!$2@$3

    # turn multiple-'@' to route-addr
    R$+@$+@$+			$:<:$1@$2>@$3
    R<:$*>@$+@$+		<@$2:$1>@$3
    R<:$*>@$+			$@@$2:$1
    R<@$*>@$+@$+		<@$2,@$1>@$3
    R<$*>@$+			$@@$2,$1

Glen Dudek
ex-postmaster@harvard.harvard.edu