[comp.mail.misc] operator precedence

kurt@hi.unm.edu (Kurt Zeilenga) (03/26/88)

What do you do with something like:

	a!b%c		(where a, b, and c could domainized)

A lot of mailers on internet appear to do:

	b%c@a		(tack on .UUCP if a isn't domainized)

I prefer:

	a!b@c		(deliver to c)

because many folks here address things to a!b and I will forward them
to d for forwarding to c.  So I give d a "a!b%c@d".   Now, I could give
d "a!b@c@d", but that has two '@', or just "a!b@c".

What is considered defacto standard way(s) of rewriting "a!b%c"?

What is the defacto standard way of doing relays as described above?

-- 
	Kurt (zeilenga@hc.dspo.gov)

ehrlich@blitz (Dan Ehrlich) (03/28/88)

In article <23560@hi.unm.edu> kurt@hi.unm.edu (Kurt Zeilenga) writes:
-...
-What is considered defacto standard way(s) of rewriting "a!b%c"?
-
-What is the defacto standard way of doing relays as described above?
-...

You should get a copy of RFC886, "Proposed Standard for Message Header
Munging".  This RFC is dated December 1983 and I have not heard or seen
any updates to it so this should be the latest "proposed standard".
Having read this document a few times it is still not clear how to
answer your question.  But my gut feeling is that "a!b%c" should be
rewritten as "a@b" or perhaps "@c:a@b", or maybe even "b@c" .... :-)
Other RFCs that may be of interest are:

	RFC822 - Standard for the Format of ARPA Internet Text Messages
	RFC974 - Mail Routing and the Domain System
	RFC976 - UUCP Mail Interchange Format Standard

--Dan Ehrlich
Dan Ehrlich <ehrlich@psuvax1.{cs.psu.edu,bitnet,uucp}>
The Pennsylvania State University, Department of Computer Science
333 Whitmore Laboratory, University Park, PA   16802
+1 814 863 1142 or +1 814 865 9723

rpw3@amdcad.AMD.COM (Rob Warnock) (03/30/88)

>In article <23560@hi.unm.edu> kurt@hi.unm.edu (Kurt Zeilenga) writes:
>-What is considered defacto standard way(s) of rewriting "a!b%c"?

The "%" is neither a "!" nor a "@", and thus is (or *should* be) left
alone by any of the transport/routing programs. It *may* be interpreted
by "local" mail delivery systems, and in particular is handled by "sendmail",
and many SMTP mailers (although seldom by non-sendmail UUCP mailers).

The defacto standard way, and the reason for the "%" at all (as opposed
to "@"), is to defer any rewriting unless you are system "a", in which
case you have already stripped the "a!", and are trying to deliver mail
to a local "user" named "b%c". At this point (and *only* at this point),
you notice the "%", and re-write "b%c" as "b@c", and then do whatever
you do locally with "@" addresses (including sending it back out again).

If you are not "a", you send it via UUCP to "a" (if you know how :-).

The purpose of the "%" is to avoid the ambiguity that arises with mixed
"!" and "@".

By the way, "%" is often used in the SMTP world. The address "b%c@a"
means exactly the same as above: If you are system "a", the "b%c" is
a "local-part", which you can (but are not required to) re-write to "b@c".
So, for example, in SMTP-land you can often send a "mail-echo" be sending
to "me%my-system@other-system".


p.s.
Note that the usual example, "a!b@c", *cannot* be parsed corectly unless
you know what kind of transport it came in on. If it came in on SMTP, then
"a!b" is the "local-part", and you should send it to "a" via UUCP. If it
came in on UUCP, then "b@c" is the "user", and you should send it to "c"
with SMTP (or maybe UUCP, depending on your mail system). Such a mixed-mode
horror should *never* be generated locally! If you *have* to send to a "domain"
via a UUCP first hop, then use full-bang domain addressing: a!c.dom.ain!b
Mailers such as "smail" understand this form.


Rob Warnock
Systems Architecture Consultant

UUCP:	  {amdcad,fortune,sun,attmail}!redwood!rpw3
ATTmail:  !rpw3
DDD:	  (415)572-2607
USPS:	  627 26th Ave, San Mateo, CA  94403

ccdan@ucdavis.ucdavis.edu (Dan Dorough) (03/30/88)

In article <23560@hi.unm.edu> kurt@hi.unm.edu (Kurt Zeilenga) writes:
> What do you do with something like:
> 	a!b%c		(where a, b, and c could domainized)
> 
> I prefer:
> 	a!b@c		(deliver to c)
> because many folks here address things to a!b and I will forward them
> to d for forwarding to c.  So I give d a "a!b%c@d".   Now, I could give
> d "a!b@c@d", but that has two '@', or just "a!b@c".
> 
> What is considered defacto standard way(s) of rewriting "a!b%c"?

the '%' hack isn't actually documented anywhere that i
know of.  for this reason, it could be considered the
"least binding token".  it's been my experience that it
is far better to resolve
	host!left%right
on the '!' and thus send <left%right> to "host" for delivery.
the advantage of the % hack is that it allows for mail
to pick it's way through systems that will hopefully
leave the '%' parts alone until the the very last.  if you
start giving it higher precedence than '!', the results
will be unpredictable.  the only time you would resolve on
the '%' in an address of
	left%right
is if the '%' is the only recognized routing token left.

--dan dorough, systems programmer, ccdan@ucdavis.edu, (916)752-3420