[PATCH] Mailstore abstraction v4 - part 2 (maildir synchronization)

Michal Sojka sojkam1 at fel.cvut.cz
Thu Apr 8 08:13:11 PDT 2010


This is the second part of mailstore abstraction patches. I do not
want this to be merged yet, but there might be some people interested
in testing this.

This patch adds a mailstore, which bi-directionally synchronizes
certain tags with maildir flags.

I use it already four weeks and it works quite well. There are the
following know bugs:

1) Viewing/storing of attachments of unread messages doesn't work. The
   reason is that when you view the message its unread tag is removed
   by elisp code. This leads to rename of the file, but Emacs still
   uses the original name to access message with the attachment.

   Workaround: close the message and open it again.

   I'm working on the solution - if the mailstore cannot open the
   message with the name passed, it tries different names with
   different maildir flags.

2) If there several messages with the same ID (e.g. one in sent folder
   and one sent back by mailing list), the flags are synchronized to
   only one of these files.

   I plan to do this:

   - When a tag is added/removed in notmuch, flags of all
     files corresponding to the message will be updated.
   - If we detect (during notmuch new) that flags of one file were
     changed by somebody else, we also change the flags for the other
     files corresponding to the message.
   - If we detect (during notmuch new) that flags of two or more files
     were changed by somebody else, we have to solve the conflict
     somehow, but I didn't invent how, yet.

The full series is available at
http://rtime.felk.cvut.cz/gitweb/notmuch.git/shortlog/refs/heads/mailstore-abstraction-v4
and can be pulled by

   git pull git://rtime.felk.cvut.cz/notmuch.git mailstore-abstraction-v4

Besides the patch sent here, there are also tests for the maildir
mailstore and a not finished implementation of the solution for 1)
above.

--Michal
   


More information about the notmuch mailing list