karelzak / mutt-kz

mutt-kz is DEPRECATED in favor of neomutt project.
https://neomutt.org
Other
296 stars 51 forks source link

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

Open larsks opened 12 years ago

larsks commented 12 years ago

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: user@example.com
> From: user@example.com
> 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 commented 12 years ago

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

karelzak commented 12 years ago

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 kzak@redhat.com http://karelzak.blogspot.com

larsks commented 12 years ago

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.

hurricanehrndz commented 9 years ago

Any update on this?