Re: Questions from a user new to notmuch

Subject: Re: Questions from a user new to notmuch

Date: Sat, 24 Mar 2012 14:04:32 +0200

To: Austin Clements, Kyle Sexton

Cc: notmuch@notmuchmail.org

From: Jani Nikula


On Thu, 22 Mar 2012 18:39:07 -0400, Austin Clements <amdragon@MIT.EDU> wrote:
> Quoth Kyle Sexton on Mar 21 at 10:21 pm:
> > 1. Using offlineimap to store mail into a Maildir, is it safe to move an
> >    already indexed message to a different folder from some other client?
> 
> Yes, mostly.  You'll have to run notmuch new for notmuch to detect the
> move, but it will detect it as a move.  I say "mostly" because until
> you run notmuch new, notmuch won't find the message file, so it won't
> be able to display the message and won't be able to synchronize any
> tag changes to its maildir flags.

If maildir.synchronize_flags is enabled (it is by default) you should
take extra care to have the mail store and notmuch database in sync (by
running "notmuch new") before changing tags that are synced with maildir
flags. Otherwise, the following scenario is possible:

1) Rename file with id:message-id in another client. Note that maildir
   flag changes are also renames.

2) "notmuch tag -unread id:message-id" will remove unread tag from the
   message, but won't find the message file, and is thus unable to sync
   the tag change to the S maildir flag. The syncing just silently
   fails.

3) The next "notmuch new" syncs maildir flags to tags, adding unread tag
   back to id:message-id, losing your tag change.

This could be considered a bug in notmuch, but not an easy one to fix
race free. See http://notmuchmail.org/special-tags/ and your
.notmuch-config for details about maildir flag synchronization.


BR,
Jani.

Thread: