MBOX-Line: From brong at fastmail.fm  Wed May 18 02:15:37 2011
To: imap-protocol@u.washington.edu
From: Bron Gondwana <brong@fastmail.fm>
Date: Fri Jun  8 12:34:45 2018
Subject: [Imap-protocol] Thoughts on keyword improvements/enhancements
In-Reply-To: <FEDA906E-72BF-445E-998C-8774B7D15770@iki.fi>
References: <20110518011645.Horde.6sTkboF5lbhN03Jd3XNndCA@bigworm.curecanti.org>
	<20110518100807.29d4b72c@arbre.eng.oslo.osa>
	<FEDA906E-72BF-445E-998C-8774B7D15770@iki.fi>
Message-ID: <20110518111537.4d466dde@arbre.eng.oslo.osa>

On Wed, 18 May 2011 11:52:27 +0300
Timo Sirainen <tss@iki.fi> wrote:

> I think this is the only way to make it completely backwards compatible with both clients and servers. mUTF7 wouldn't work because keywords are case-insensitive, but something else would, as long as servers allow long enough keywords. The encoded keywords could begin with some yet another prefix character, such as #. And it could be required that it's used only when non-atom-chars are in the name. So it would be possible to set, for example:
> 
>  - $Spam
>  - Spam
>  - Work
>  - #121h5jh125jh12fjs2
> 
> Or possibly assume that # (or something else) is so rarely used, that the whole keyword wouldn't have to be encoded:
> 
>  - Tax#20Forms#20#282011#29
> 
> That would still be readable with old clients that show keywords as-is, and wouldn't require anything special from server side.

Hmm... here's what we're setting for "the name of the folder the message
was deleted from" in our new web interface to allow "undelete" to work:

xof-KRZGC43I xof-IFZGG2DJOZSQ xof-KNSW45BAJF2GK3LT

MIME::Base32::encode($FlagFolderName);

http://www.ietf.org/rfc/rfc3548.txt

Base32 is case-insensitivity-safe, but better packing than base16.

I think it's better to just base32 the entire string rather than trying
for partial encoding - you're still going to get case folding otherwise.

So something like "if it starts with a # it's a base32 encoded UTF8 keyword"
would be fully flexible, and backwards compatible.

Bron.

