[notmuch] Mailstore abstraction & maildir synchronization

Michal Sojka sojkam1 at fel.cvut.cz
Thu Mar 18 08:39:36 PDT 2010


Hi all,

I've finally found some time to implement the mailstore abstraction
was initially described in id:87ljecmnbd.fsf at steelpick.localdomain and
id:87eijqlz54.fsf at steelpick.localdomain.

The idea is to allow notmuch operate on different types of mail
storage (e.g. mail in git repositories) and to store the tags in the
storage together with mails. The aim is the ability to synchronize
mails and tags between computers. The following patch series is the
first version which I'm able to use on daily basis so I'd like to get
some feedback.

In the current form, the patch series implements two mail stores:
1. plain files (compatible with the current notmuch)
2. maildir (synchronizes certain tags with maildir flags)

The series passes the test suite. For the maildir store, there are
additional tests, but you need need the modularized testsuite (taken
from git). The whole patch series is also available from
git://rtime.felk.cvut.cz/notmuch.git mailstore-abstraction-v1 (this
branch wont be rebased).

Known bugs and limitations:

- Only file-based storage is suported. Notmuch access the files
  directly, and not via the mailstore interface.

- (maildir) Viewing/storing of attachments of unread messages doesn't
  work. The reason is that when you view the message it its unread tag
  is removed which leads to rename of the file, but Emacs still uses
  the original name to access the attachment.

  Workaround: close the message and open it again.

Maildir howto:

1. Backup you emails
2. Apply the patches (at least 1-3)
3. Configure notmuch to use maildir store
cat > ~/.notmuch-config <<EOF
[mailstore]
type=maildir
EOF
4. Enjoy

Advantages for me:

- Whenever I read a message my mobile phone gets that information
  since I run offlineimap periodically on background.
- My mailsync script (notmuch new + tagging) is much faster because it
  does not call offlineimap and notmuchsync (two times). I call it
  manually, because I want to decide when new mail should appear.

Cheers,
-Michal


More information about the notmuch mailing list