pcg@cs.aber.ac.uk (Piercarlo Grandi) (12/27/90)
Note followups are redirected to "comp.mail.misc". 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. Oh again. % should *never* be expanded by other than the target machine of a mail exchange. The rule is that if the local part of an address contains a %, the rightmost % is turned into a @ and the MTA is reinvoked. This is perfectly unambiguous. I would like to point out that on a UUCP based mail system, only ! exists, and BOTH @ and % are meaningless; on an RFC822 based mail system, only @ exists, and ! and % (before conversion into @) are meaningless. 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'. When the mail arrives on 'b', the delivery software looks at the delivery name, 'c%d.e.f'. ONLY AT THIS POINT the '%' may assume special meaning, if 'b' is an UUCP-to-Internet gateway, then the UUCP MTA converts the delivery name 'c%d.e.f' to 'c@d.e.f' and resubmits the message to the Internet MTA. If 'b' is a pure UUCP site, then the message will be delivered to local address 'c%d.e.f', e.g. by appending to mailbox '/usr/mail/c%d.e.f'. on a RFC822 machine: this is a local address. If the '%' hack has been enabled, this is converted to 'a!b!c@d.e.f', the MTA is reinvoked, and it will deliver the mail to host 'd.e.f', which will deliver the message to local address 'a!b!c', e.g. appending to mailbox '/usr/spool/mail/a!b!c'. If 'd.e.f' is an Internet-to-UUCP mail gateway, the Internet MTA will instead pass the message with an envelope of 'a!b!c' to the UUCP MTA, and it will eventually be delivered to local address 'c' on site 'b', a neighbour of 'a'. Example: pcg%uk.ac.aber.cs@nsfnet-relay.ac.uk on a Janet machine: this is in error. There is no site called 'nsfnet-relay.ac.uk' on Janet. on an Internet machine: the mail is delivered to 'nsfnet-relay.ac.uk' (a valid but illegal DNS address :->), and the Internet MTA there will get the local delivery address of 'pcg%uk.ac.aber.cs'. Since 'nsfnet-relay.ac.uk' is an Internet-to-Janet gateway, and this mail comes from the Internet side of the gateway, this is interpreted should be a Janet address, substituting the '%' for a '@', getting 'pcg@uk.ac.aber.cs', which is a valid (and legal) Janet name, and the message is delivered to 'pcg' in the 'uk.ac.aber.cs' domain. Example: lws%comm.wang.com@uk.ac.nsfnet-relay On a Janet machine: 'uk.ac.nsfnet-relay' is a Janet domain, so the mail is delivered there for 'lws%comm.wang.com'. Since it is a Janet-to-Internet gateway, '%' is turned to '@' and since the message arrived from the Janet side it is presumed to be intended for the Internet. 'lws@comm.wang.com' is exmained, 'comm.wang.com' is a valid (and legal) Internet domain, and the mail is forwarded to it for delivery to the 'lws' local address. On an Internet machine: thsi is in error. There is no site called 'uk.ac.nsfnet-relay' in the Internet. I hope this is very clear -- the precedence of '%' does not matter at all. The rule is that the rightmost '%' is turned into a '@' only when considering the local part of an address, and only on machines that are gateways. Final example: a roundtrip from Janet to Internet and backwards: pcg%uk.ac.aber.cs%nsfnet-relay.ac.uk%comm.wang.com@uk.ac.nsfnet-relay This should result in a rountrip, because each stage is only authorized to resolve to '@' the *rigthmost* '%'. Ah if only this were common practice! Incidentally, here is a good occasion to repeat my lament for Internet (and Janet) standards for addressing other naming domains. In the examples above the gateway was always between two domain. What if the gateways relays between more than two domains? For example, consider the following address (remember, it is not a route! none of the examples above involved routes!) from an UUCP site: a!b!c::d%e.f and 'b' is a gateway between from UUCP to the Internet and DECnet. When the UUCP MTA of 'b' sees a local delivery address of 'c::d%e', will it be resubmit the message to the Internet MTA as 'c::d@e.f', for delivery to local address 'c::d' on host 'e.f', or to the DECnet MTA for delivery to local address 'd%e.f' on host 'c'? The ambiguity here is inescapable, as when requesting the services of a gateway we should have some way to indicate which output MTA to use for forwarding the message; parsing the syntax of the address is not enough. For a more common example, consider a gateway from UUCP to Internet or Janet; the ambiguity here is inescapable, because addresses under both the Internet DNS and the Janet NRS have exactly the same syntax. So far ambiguity resolution has been haphazardly been done by UUCP to Janet or Internet gateways (like ...!mcsun!ukc, a.k.a. uk.ac.ukc, a.k.a. ukc.ac.uk) by looking at which of the extremities of the domain name looked like an NRS or DNS top domain; now that 'cs' may validly occur as a top domain name in the DNS, 'mistery.cs' can be interpreted both as 'the Czech machine mistery' or 'the machine of the computer science department of the mistery UK company or university or defense establishment'. It is possible to informally anchor domain names in the DNs by using '.' as root indicator, so that 'mistery.cs.' is surely (but really?) a DNS name, but this is narrow escape. The problem out to be solved, not fudged. -- 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