mutt-kz icon indicating copy to clipboard operation
mutt-kz copied to clipboard

Using maildir mailboxes, finding messages can cause them disappear from notmuch

Open larsks opened this issue 12 years ago • 4 comments

I've just started looking at the mutt/notmuch fork, and I keep getting bitten by this: the act of finding messages with e.g. vfolder-from-query can cause them to disappear. This happens because mutt will move a message from new/ to cur/ when it is first accessed.

To see this in action, create a maildir with a single message in new/:

$ mkdir -p folder/{cur,new}
$ cat > folder/new/1:2, <<EOF
> To: [email protected]
> From: [email protected]
> Subject: this is a test
> 
> This is a test.
> EOF
$ find folder -type 1
folder/new/1:2,
$ mutt -f folder
...
$ find folder -type 1
folder/cur/1:2,

This is scary when a search first returns hundreds of results and when run just seconds later returns only 2 results (the immediate reaction is, "what happened to all my mail!").

I don't know if there's a non-invasive fix for this, but it would make the behavior of mutt and notmuch much more predictable.

larsks avatar Apr 11 '12 00:04 larsks

This was discussed briefly on the notmuch list in 2010. Having mutt reindex files after moving them would fix the problem.

larsks avatar Apr 11 '12 01:04 larsks

On Tue, Apr 10, 2012 at 05:55:15PM -0700, Lars Kellogg-Stedman wrote:

I've just started looking at the mutt/notmuch fork, and I keep getting bitten by this: the act of finding messages with e.g. vfolder-from-query can cause them to disappear. This happens because mutt will move a message from new/ to cur/ when it is first accessed.

The mutt should be able to update the filename in notmuch DB, but you have to access the email by virtual folders only.

If you access the mail by traditional way (mutt -f maildir) then notmuch DB will not be updated (and you have to use the command "notmuch new" to fix the problem).

I'll try to fix this disadvantage.

Karel

Karel Zak [email protected] http://karelzak.blogspot.com

karelzak avatar Apr 11 '12 12:04 karelzak

That would be great. It would be nice if mutt would update the notmuch database whenever a file is moved, regardless of whether it is in a virtual folder view or a traditional folder view.

larsks avatar Apr 12 '12 14:04 larsks

Any update on this?

hurricanehrndz avatar Oct 19 '15 16:10 hurricanehrndz