unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: "W. Trevor King" <wking@tremily.us>
To: David Bremner <david@tethera.net>
Cc: Daniel Kahn Gillmor <dkg@fifthhorseman.net>, notmuch@notmuchmail.org
Subject: Re: encoding of message-ids
Date: Wed, 24 Feb 2016 09:15:24 -0800	[thread overview]
Message-ID: <20160224171524.GS4265@odin.tremily.us> (raw)
In-Reply-To: <877fi3v4t6.fsf@zancas.localnet>

[-- Attachment #1: Type: text/plain, Size: 2068 bytes --]

On Wed, Feb 17, 2016 at 09:34:29AM -0400, David Bremner wrote:
> Daniel Kahn Gillmor writes:
> > That said, RFC 2047 suggest that its encodings are only relevant
> > in places where a "text" token would be used.  Message-ID (and
> > References and In-Reply-To) are intended to only contain
> > dot-atom-text tokens.  So probably it would be more correct to
> > avoid applying to these specific fields.
> >
> > i dunno that it's a big deal though, given the analysis above.
>
> I guess there are two seperate issues. One is the (mildly bogus)
> application of RFC2047 decoding to message-ids. The other other is
> the coercion into utf8 from whatever wacky 8bit encoding some
> creative person might use in a message-id.

It looks like there's already an “implicit encodings are complicated”
RFC discussing this issue [1].  RFC 6532 overrides (among other
things) the atext behind message-id [2,3] for message/global messages.
Other related RFCs cover internationalized domain names [4] and
internationalized email addresses [5].  I think we should:

* Store message IDs as NFKC UTF-8 in notmuch (do we already do this?).
* For message/global messages:
  * Convert headers to Unicode using UTF-8 (per RFC 6532).
* For non-message/global messages:
  * Ignore any RFC 2047 =? encoding or RFC 5890 xn-- encoding that may
    be present.
  * Convert to Unicode by percent-encoding [6] (e.g. ‘ü%’ represented
    as the three UTF-8 bytes ‘\xc3\xbc\x25’ would be represented by
    the Unicode ‘%C3%BC%25’).

Cheers,
Trevor

[1]: https://tools.ietf.org/html/rfc6055
[2]: https://tools.ietf.org/html/rfc5322#section-3.6.4
[3]: https://tools.ietf.org/html/rfc5322#section-3.2.3
[4]: https://tools.ietf.org/html/rfc5890
[5]: https://tools.ietf.org/html/rfc6530
[6]: https://tools.ietf.org/html/rfc3986#section-2
[7]: https://tools.ietf.org/html/rfc2606#section-2

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2016-02-24 17:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-16 12:38 encoding of message-ids David Bremner
2016-02-16 19:02 ` Daniel Kahn Gillmor
2016-02-17 13:34   ` David Bremner
2016-02-24 17:15     ` W. Trevor King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160224171524.GS4265@odin.tremily.us \
    --to=wking@tremily.us \
    --cc=david@tethera.net \
    --cc=dkg@fifthhorseman.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).