I'm fumbling on this, and I think you may need to ask for help from
others on the IETF-822 list. I don't know how widely mail agents use
embedded comment strings in message-ID fields, for example. You may
need to explicitly call out the algorithm for determining the mid: URL
from a message with a Message-ID by removing the comments, the quotes
from quoted strings, and then encoding using the %nn hex encoding the
result into a URL. The opposite algorithm will require you to remove
the URL encoding and quote the result if it contains any special
characters.
In addition, I think you may need to change:
id-spec = local-part "@" hostname
to
id-spec = local-part "@" host
so as to allow numeric identifiers in message-IDs.
However, I don't know if it is necessary to change
local-part = 1*uchar
to
local-part = word *("." word) ; uninterpreted
; case-preserved
word = atom
atom = 1*uchar
and then add something that starts as follows (I'm having trouble
finishing this)...
# where hostname and uchar are defined as in RFC 1738. The
# id-spec is derived from the addr-spec inside a msg-id
# of RFC 822, except that only fully qualified domain names
# or numeric IP addresses are allowed in the "host" portion
# (to be compatible with RFC 1738 hosts and not introduce
# encoding of any characters in the host part), and where
# the local-part of the message-ID or content-ID has no
# quoted strings.
# Thus, to convert a message-ID into a MID URL, it is
# necessary to remove any quotes, parenthesized comments,