[comp.mail.misc] Precedence of ! and %

fitz@wang.com (Tom Fitzgerald) (01/03/91)

> On 18 Dec 90 14:22:13 GMT, lws@comm.wang.com (Lyle Seaman) said:
> lws> It's worth noting that the world is still pretty split about how to
> lws> handle the % hack, with some sites giving it precedence over ! and
> lws> others not.  This is an unfortunate situation.  The only solution
> lws> is to avoid mixing % and !  if at all possible.

pcg@cs.aber.ac.uk (Piercarlo Grandi) writes:
> Oh again. % should *never* be expanded by other than the target machine
> of a mail exchange.
>
> Example: a!b!c%d.e.f
>     on a UUCP machine: route this to the 'b' site which is a
>     neighbour of the 'a' site, and on 'b' deliver mail to
>     'c%d.e.f'.

This is excellent advice, and I agree with it 100%, but bear in mind that
it contradicts RFC1123, which says that the example should be passed to
d.e.f by whatever means, and d.e.f should decide what to do with a!b!c.
(Basically the recommendation is that ! binds tighter than %).

Many machines (including UUNET) disobey RFC1123 in this respect, and get
mail delivered.  Many other machines comply with RFC1123, and generally
lose mail from UUCP sites that has %'s in the destination address.

I'd agree that addresses with both !'s and %'s should be avoided whenever
possible, but UUCP sites can't avoid ! addresses, and lots of mail gateways
rewrite "From:" addresses into a % form.

---
Tom Fitzgerald   Wang Labs        fitz@wang.com
1-508-967-5278   Lowell MA, USA   ...!uunet!wang!fitz

david@bacchus.esa.oz.au (David Burren) (01/03/91)

In <aynnmf.356@wang.com> fitz@wang.com (Tom Fitzgerald) writes:

>> On 18 Dec 90 14:22:13 GMT, lws@comm.wang.com (Lyle Seaman) said:
>> lws> It's worth noting that the world is still pretty split about how to
>> lws> handle the % hack, with some sites giving it precedence over ! and
>> lws> others not.  This is an unfortunate situation.  The only solution
>> lws> is to avoid mixing % and !  if at all possible.

>pcg@cs.aber.ac.uk (Piercarlo Grandi) writes:
>>
>> Example: a!b!c%d.e.f
>>     on a UUCP machine: route this to the 'b' site which is a
>>     neighbour of the 'a' site, and on 'b' deliver mail to
>>     'c%d.e.f'.

>This is excellent advice, and I agree with it 100%, but bear in mind that
>it contradicts RFC1123, which says that the example should be passed to
>d.e.f by whatever means, and d.e.f should decide what to do with a!b!c.
>(Basically the recommendation is that ! binds tighter than %).

>Many machines (including UUNET) disobey RFC1123 in this respect, and get
>mail delivered.  Many other machines comply with RFC1123, and generally
>lose mail from UUCP sites that has %'s in the destination address.

To quote from section 5.2.16 of RFC1123:

	It is suggested that "%" have lower precedence than any other
	routing operator (e.g., "!") hidden in the local-part; for
	example, "a!b%c" would be interpreted as "(a!b)%c".

To me this seems a contradiction.  Surely if "%" has lower precedence
than "!" then "a!b%c" should be interpreted as "a!(b%c)"!
Assuming this, sites such as uunet are doing "the right thing".  To me
it seems the sensible way of doing things.

No wonder so many sites "don't comply" with RFC1123 in this respect.

Mind you, I have a mail redirect going through a host which interprets
"%" above "!", and the mail feed for a domain of ~20 machines would break
if they suddenly started doing "the right thing".

Is this a typo in the RFC, or am I totally deranged?
_____________________________________________________________________________
David Burren [Athos]                          Email: david@bacchus.esa.oz.au
Software Development Engineer                 Phone: +61 3 819 4554
Expert Solutions Australia, Hawthorn, VIC

fletcher@cs.utexas.edu (Fletcher Mattox) (01/04/91)

    In article <aynnmf.356@wang.com> fitz@wang.com (Tom Fitzgerald) writes:
    pcg@cs.aber.ac.uk (Piercarlo Grandi) writes:

    > Example: a!b!c%d.e.f
    >     on a UUCP machine: route this to the 'b' site which is a
    >     neighbour of the 'a' site, and on 'b' deliver mail to
    >     'c%d.e.f'.
    
    This is excellent advice, and I agree with it 100%, but bear in mind that
    it contradicts RFC1123, which says that the example should be passed to
    d.e.f by whatever means, and d.e.f should decide what to do with a!b!c.

Huh?  I'm curious where in 1123 this is stated.  Or even implied.

lear@turbo.bio.net (Eliot) (01/04/91)

I believe Tom Fitzgerald is referring to RFC 1123 (section 5.2.16),
which reads as follows in DISCUSSION:

              Although source routes are discouraged within the Internet
              (see Section 5.2.6), there are non-Internet mail
              environments whose delivery mechanisms do depend upon
              source routes.  Source routes for extra-Internet
              environments can generally be buried in the "local-part"
              of the address (see Section 5.2.16) while mail traverses
              the Internet.  When the mail reaches the appropriate
              Internet mail gateway, the gateway will interpret the
              local-part and build the necessary address or route for
              the target mail environment.

              For example, an Internet host might send mail to:
              "a!b!c!user@gateway-domain".  The complex local part
              "a!b!c!user" would be uninterpreted within the Internet
              domain, but could be parsed and understood by the
              specified mail gateway.
              An embedded source route is sometimes encoded in the
              "local-part" using "%" as a right-binding routing
              operator.  For example, in:

                 user%domain%relay3%relay2@relay1

              the "%" convention implies that the mail is to be routed
              from "relay1" through "relay2", "relay3", and finally to
              "user" at "domain".  This is commonly known as the "%-
              hack".  It is suggested that "%" have lower precedence
              than any other routing operator (e.g., "!") hidden in the
>>>>>>>>>>>   local-part; for example, "a!b%c" would be interpreted as
>>>>>>>>>>>   "(a!b)%c".
		
              Only the target host (in this case, "relay1") is permitted
              to analyze the local-part "user%domain%relay3%relay2".


If you look at the above example, it would appear to be in error,
because they do in fact give % higher precedence than !, even though
they claim that one should not.  However, the example is consistant
with their usage of "%" as a right-binding operator.  The easiest way
to get around this mess is to keep the following two issues in mind:

[1]	The "%-hack" is unofficial at best, and not recommended.  If
	you can find a better way, use the other address.

[2]	When they mentioned %, the authors suggested that it receive
	lowest precedence.

It is important to restate the group's major wish that % or any other
form of source routing NOT be used at all for internet mail
addressing (Section 5.2.6):

         DISCUSSION:
              The intent is to discourage all source routing and to
              abolish explicit source routing for mail delivery within
              the Internet environment.  Source-routing is unnecessary;
              the simple target address "user@domain" should always
              suffice.  This is the result of an explicit architectural
              decision to use universal naming rather than source
              routing for mail.  Thus, SMTP provides end-to-end
              connectivity, and the DNS provides globally-unique,
              location-independent names.  MX records handle the major
              case where source routing might otherwise be needed.

My point in mentioning the above paragraph is that any site that is
only reachable via the %-hack should be converted into an MX site.
-- 
Eliot Lear
[lear@turbo.bio.net]

Makey@Snoopy.Logicon.COM (Jeff Makey) (01/04/91)

In article <aynnmf.356@wang.com> fitz@wang.com (Tom Fitzgerald) writes:
>Many machines (including UUNET) disobey RFC1123 in this respect, and get
>mail delivered.  Many other machines comply with RFC1123, and generally
>lose mail from UUCP sites that has %'s in the destination address.

The recommendation in RFC 1123 that internet hosts give higher
precedence to % than to ! (e.g., mail addressed to a!b%c should be
delivered to c, which then interprets a!b) is unfortunate, because it
is unreasonable for internet hosts that are also UUCP hosts to do so.
On the other hand, it is good advice for internet hosts that are *not*
also UUCP hosts, since they would not normally be expected to use ! as
a routing operator.

                           :: Jeff Makey

Department of Tautological Pleonasms and Superfluous Redundancies Department
    Disclaimer: I am just a guest of Logicon.
    Domain: Makey@Logicon.COM    UUCP: ucsd!snoopy!Makey

fletcher@cs.utexas.edu (Fletcher Mattox) (01/04/91)

RFC1123:
	... It is suggested that "%" have lower precedence
	than any other routing operator (e.g., "!") hidden in the
	local-part; for example, "a!b%c" would be interpreted as
	"(a!b)%c".

The parentheses can be interpreted mathematically.  
I.e. the operands of ! should be evaluated first, thus giving !
higher precedence than %.  I suspect this is what the authors
had in mind.  I agree it is confusing.

lear@turbo.bio.net (Eliot) (01/05/91)

Makey@Snoopy.Logicon.COM (Jeff Makey) writes:
>The recommendation in RFC 1123 that internet hosts give higher
>precedence to % than to ! (e.g., mail addressed to a!b%c should be
>delivered to c, which then interprets a!b) is unfortunate...

It is also untrue, Jeff.  There was one confusing example in the RFC
(see my previous message), but they stated quite clearly that % should
have lowest precedence of any routing operators, if you give it any at
all.  AND they specifically give ! as an example of an operator that
should have higher precedence.

Next subject, please.
-- 
Eliot Lear
[lear@turbo.bio.net]

fitz@wang.com (Tom Fitzgerald) (01/05/91)

Makey@Snoopy.Logicon.COM (Jeff Makey) writes:
> The recommendation in RFC 1123 that internet hosts give higher
> precedence to % than to ! (e.g., mail addressed to a!b%c should be
> delivered to c, which then interprets a!b) is unfortunate, because it
> is unreasonable for internet hosts that are also UUCP hosts to do so.

Right, if "UUCP hosts" means "all hosts listed in the UUCP maps", not
just "all hosts that communicate via UUCP".  There are machines that don't
talk UUCP that are listed in the maps, so a smart mailer can still route
mail through them without the sender being aware of it.

> On the other hand, it is good advice for internet hosts that are *not*
> also UUCP hosts, since they would not normally be expected to use ! as
> a routing operator.

You mean, some machine might have "!" as a character in user names?  I
assume nobody is actually doing this, in which case it doesn't really
matter.

---
Tom Fitzgerald   Wang Labs        fitz@wang.com
1-508-967-5278   Lowell MA, USA   ...!uunet!wang!fitz

Makey@Snoopy.Logicon.COM (Jeff Makey) (01/05/91)

In article <Jan.4.11.14.52.1991.6454@turbo.bio.net> lear@turbo.bio.net (Eliot) writes:
>Makey@Snoopy.Logicon.COM (Jeff Makey) writes:
>>The recommendation in RFC 1123 that internet hosts give higher
>>precedence to % than to ! (e.g., mail addressed to a!b%c should be
>>delivered to c, which then interprets a!b) is unfortunate...
>
>It is also untrue, Jeff.

My statement is quite correct, thank you.  I am just using the word
"precedence" in a different manner than RFC 1123.  The last time this
question came up (in comp.mail.uucp) I wrote to Bob Braden, the
indicated author of RFC 1123, and asked for a clarification.  His
response was:

>It was intended to indicate that the message would be delivered to
>c, who would interpret a!b as the local part.

Regardless of how one defines "precedence" or interprets parentheses,
this is *not* the way UUCP hosts should work.

                           :: Jeff Makey

Department of Tautological Pleonasms and Superfluous Redundancies Department
    Disclaimer: I am just a guest of Logicon.
    Domain: Makey@Logicon.COM    UUCP: ucsd!snoopy!Makey

pcg@cs.aber.ac.uk (Piercarlo Grandi) (01/07/91)

On 3 Jan 91 22:59:49 GMT, Makey@Snoopy.Logicon.COM (Jeff Makey) said:

Makey> In article <aynnmf.356@wang.com> fitz@wang.com (Tom Fitzgerald) writes:

fitz> Many machines (including UUNET) disobey RFC1123 in this respect, and get
fitz> mail delivered.  Many other machines comply with RFC1123, and generally
fitz> lose mail from UUCP sites that has %'s in the destination address.

RFC 1123 is a horrid kludge, at least in this respect. RFCs are
supposedly only meant for sites on the Internet *only*. As far as the
other RFCs go, there is nothing else but the Internet.

Makey> The recommendation in RFC 1123 that internet hosts give higher
Makey> precedence to % than to ! (e.g., mail addressed to a!b%c should
Makey> be delivered to c, which then interprets a!b) is unfortunate,
Makey> because it is unreasonable for internet hosts that are also UUCP
Makey> hosts to do so.  On the other hand, it is good advice for
Makey> internet hosts that are *not* also UUCP hosts, since they would
Makey> not normally be expected to use ! as a routing operator.

Ah yes, but a host that is both an on the Internet and another network
and passes mail between the two is a gateway. There is no provision (let
me scream this as many times as I can) for gateways to other networks in
the RFCs, as the Internet is supposed to be entirely self-contained.

The RFC 1123 (which is in itself a kludge) suggestion only makes sense
for a mail gateway, and is totally superfluous, as on the Internet '!'
*is not* a routing operator -- it is just a character in the local part
of an Internet address. RFC 1123 makes '%' into an Internet routing
operator, and obsoletes "@a,@b:u@c" style notation. Argh.

Note that IMNHO a gateway between UUCP and RFC complying networks should
interpret things *differently* depending on the source of the message --
if the message came in from an UUCP mail style network, then '@' *and*
'%' have no special meaning, if it came in from an RFC mail style
network, then '!' has no special meaning. Things would be much clearer
if gatewaying did not happen by parsing local addresses in the RFC style
world, because they were not designed that way.

	Note that in the the UUCP style world there is in a sense no
	local address part -- '!' acts as a routing, naming, and
	addressing operator, because no UUCP site should even look at
	what is beyond the first '!' in the envelope, and local delivery
	only happens when there are no '!' in the envelope. IMNHO bang
	"paths" are a *vastly* better and more flexible technology than
	RFC or Janet style addresses. (This paragraph courtesy of the
	"Campaign for a Bangista Internet").
	

This is all extremely distasteful. There is something rotten in the
state of ... OOPS, sorry wrong play :-).
--
Piercarlo Grandi                   | ARPA: pcg%uk.ac.aber.cs@nsfnet-relay.ac.uk
Dept of CS, UCW Aberystwyth        | UUCP: ...!mcsun!ukc!aber-cs!pcg
Penglais, Aberystwyth SY23 3BZ, UK | INET: pcg@cs.aber.ac.uk

tinkelman@camb.com (Bob Tinkelman) (01/12/91)

In article <893@bacchus.esa.oz.au>, david@bacchus.esa.oz.au (David Burren)
writes:
> To quote from section 5.2.16 of RFC1123:
> 
> 	It is suggested that "%" have lower precedence than any other
> 	routing operator (e.g., "!") hidden in the local-part; for
> 	example, "a!b%c" would be interpreted as "(a!b)%c".
> 
> To me this seems a contradiction.  Surely if "%" has lower precedence
> than "!" then "a!b%c" should be interpreted as "a!(b%c)"!
... 
> Is this a typo in the RFC, or am I totally deranged?

It's *not* a typo.  (Not to imply the 2nd part of your question!)

The author of the RFC was using the term `precendence' in the manner that
it is used in mathematics when talking about the order in which binary
operators are applied in an expression, lacking explicit directions via
parentheses.  For example, in normal usage multiplication is said to have
higher precendence than addition, so a*b+c = (a*b)+c.  It's called `higher
precendence' because you do it first.  However, it was the analogy with
the parentheses that the RFC was driving at, as evidenced by the example:
a!b%c means (a!b)%c.
-- 
Bob Tinkelman, Cambridge Computer Associates, Inc., 212-425-5830, bob@camb.com