[neomutt-devel] [neomutt/neomutt] Add support to IMAP custom keywords (#399)

guyzmo z+mutt+neomutt at m0g.net
Fri Feb 17 16:22:39 CET 2017

moving the discussion over the ML.

On Fri, Feb 17, 2017 at 01:27:38AM -0800, Pietro Cerutti wrote:
> It is my interpretation of the standard and current custom that IMAP
> Flags are meant to carry **client**-specific info such as colouring
> (Mail.app) or implementation-specific labels (`Junk`,  `NotJunk` in
> GMail).
> This is in contrast to the `X-Label` header, which is meant to carry **user**-defined tags.

I don't think a difference shall be made. Yes, IMAP flags are carrying
some information used by the client, but in the end that information is
user-defined. There's just some UX in the other MUAs to hide the
implementation details.

> There are in my opinion two consequences that come from this difference:

> 1. IMAP Flags should be machine-readable, whereas `X-Labels` should be
> user-readable. This is also clear from the fact that IMAP Flags have a
> well-defined syntax, while X-Labels can take wathever value a header
> can, including being encoded in something different than us-ascii.

As shown in documentation¹, X-Labels have been standardised in the
RFC2822 as comma space delimited keywords in the `Keyword:` header, and
the labels implementation of mutt supports that.

All in all keywords and labels are meant to be both human readable and
machine readable, because in the end they're used directly or indirectly
bu an user to lookup and/or group e-mails.


> 2. IMAP Flags should not (or even cannot) be propagated outside of the
> specific session environment, meant as combination of a single
> server/client instance that agree on their semantics, whereas
> `X-Labels` are propagated as part of the rfc822 message.

indeed, the same way notmuch tags are being handled in a separate index,
and can only be accessed through virtual mailboxes generated by notmuch

> For these reasons, I think it is wrong to allow the user to store
> arbitrary information in IMAP Flags.
> As a contrasting example, I would be in favour of using this mechanism
> to enhance the user experience, e.g., to extend flagging (`!`) with
> multiple priorities.

While the syntax is, the semantics of the IMAP keywords are not
standard, it's implementation specific. So what Apple Mail does is not
necessarily interoperable with GMail, or Dovecot. Actually, GMail offers
a way to label mails using custom keywords that is exposed with that


More information about the neomutt-devel mailing list