Syncing IMAP keywords using xattrs: Modify what where in the codebase?

Florian Friesdorf flo at
Mon Jan 7 16:23:06 GMT 2013

Hi Erik, Dan,

@Erik: I'm glad you are following up on this :)

Dan Christensen <jdc at> writes:
> Erik Quaeghebeur <offlineimap at> writes:
>> I'd like to use notmuch without losing the advantages of IMAP and I
> (..)
> Even better, run dovecot locally and let it handle the details of
> keyword storage.  Then offlineimap just needs to be modified so that
> when doing IMAP<-->IMAP synchronization, keywords are passed along.

notmuch needs a maildir structure to index, dovecot's maildir++ should
work. However, notmuch would need to be taught about dovecot's keyword

"Dovecot stores keywords in the maildir filename's flags field using
letters a..z. This means that only 26 keywords are possible to store in
the maildir. If more are used, they're still stored in Dovecot's index
files. The mapping from single letters to keyword names is stored in
dovecot-keywords file."[1]

That means we'd need two mechanisms in notmuch for keywords.

With xattr the keywords would be stored on the file holding the mail,
but needs to be fetched for each mail individually. dovecot's solution
knows them already by having the filename for the first 26 and stores
the rest in one place.

I would expect poorer performance for xattr vs dovecot.

Notmuch has an open feature request to map folders to tags[2]. Folders
with a special prefix "keywords." could be used and emails hardlinked
into them.

list of keywords: stat dir, filter for and remove prefix
all mails for specific keyword: stat keyword dir
keywords for one mail: not directly possible, needs to be done via above methods

@Erik: my next step would be consulting with the notmuch developers, but
I lack the time to do that / to follow up on it. In case you do, would
be great if you could Cc me on that.


Florian Friesdorf <flo at>
  GPG FPR: 7A13 5EEE 1421 9FC2 108D  BAAF 38F8 99A3 0C45 F083
Jabber/XMPP: flo at
IRC: chaoflow on freenode,ircnet,blafasel,OFTC
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <>

More information about the OfflineIMAP-project mailing list