MBOX-Line: From no263 at dpmms.cam.ac.uk  Thu Feb 20 08:25:53 2014
To: imap-protocol@u.washington.edu
From: Nicolas Ojeda Bar <no263@dpmms.cam.ac.uk>
Date: Fri Jun  8 12:34:52 2018
Subject: [Imap-protocol] MUTF7, UTF8, and Unicode flags
Message-ID: <CAPunWhCDfYrqx_Px-072QAjZbog2DFz9O=48WnCxaxOov-VNVQ@mail.gmail.com>

Dear List,

I am trying to implement an IMAP4rev1 client correctly, and was a
little lost with respect to the use of MUTF7 and more generally how
unicode works with respect to IMAP. I am writing so maybe someone more
experienced can correct my misunderstandings.

1. First of all, the page
<http://fetchmail.berlios.de/Mailbox-Names-UTF7.html> seems to
indicate that mailboxes names must be encoded/decoded into MUTF7 when
talking to the server. Period. Now, if the client happens to receive a
name that contains a byte that does not fit in 7 bits, then it must
automatically consider that name to be encoded in UTF8, in which case
the MUTF7 decoding is not necessary.

2. Is the same true for Flags? I did a little experimenting with Gmail
and it seemed to be encoding flags with MUTF7 (but I am not 100% sure
about this)... In general, are flags supposed to be encoded in any
particular manner?

I am sure I will have more questions as I progress, but if I could
understand these two points I would be happy already.

Thanks a lot!

Best wishes,
Nicolas

