Syncing IMAP keywords using xattrs: Modify what where in the codebase?
offlineimap at equaeghe.nospammail.net
Fri Jan 4 12:54:01 GMT 2013
I'd like to use notmuch without losing the advantages of IMAP and I make
extensive use of IMAP keywords[0, Sec.2.3.2 Par.3]. However, offlineimap
does not sync them, I guess because the Maildir spec gives no
pointers to how to store arbitrary additional flags.
In 2007, on this list, Florian Friesdorf suggested using extended
To me, this seems like a good idea. (Is it?)
I tried to look at the offlineimap source to see whether i could (with
my limited programming skills) modify it to make this work. Trying to
discover what I needed to do, I bumped into flagsimap2maildir and
flagsmaildir2imap in imaputil.py.
For IMAP->Maildir, my initial idea was to add a companion function
flags = set(flagstring[1:-1].split())
return (flags - imapsysflags)
imapsysflags = set(['\\Seen',
and then use its output to add a user.imap.keywords xattr to the file
corresponding to the message being dealt with (using pyxattr or
xattr python modules?). I've not considered keyword modification of
an already synchronized message yet.
Maildir->IMAP would be similar, in reverse.
Now, I didn't get further than imaputil.py, because I don't have a good
overview of the codebase (and have a limited experience in programming
anything but applied math). Therefore: could anybody tell me what would
need to be modified where in the codebase?
P.S.: Actually, for my personal use case, I'd also consider straying
from the Maildir spec by omitting the ':info'-part and put the system
flags in a user.imap.sysflags xattr. I'd have to augment notmuch with
functionality to read and write the xattrs (using the python bindings?).
More information about the OfflineIMAP-project