Re: Tagging messages sometimes causes them to be marked as old

Subject: Re: Tagging messages sometimes causes them to be marked as old

Date: Thu, 31 Aug 2023 16:08:10 +0200

To: David Bremner

Cc: notmuch@notmuchmail.org

From: Andreas Kusalananda Kähäri


On Thu, Aug 31, 2023 at 01:24:25PM +0000, David Bremner wrote:
> Andreas Kusalananda Kähäri <andreas.kahari@abc.se> writes:
> 
> 
> > (and similarly for the other accounts; it does not matter if I do a
> > "path:" or modify it into a "folder:" search).  This works and tags the
> > messages correctly, however, for some reason, any unread mail are also
> > marked as "old" in mutt (the mail file is moved from the "new" to the
> > "cur" directory in the maildir).  This does not happen with the tagging
> > done by the original "post-new" hook shown above.  It *does* happen if I
> > add the tagging to the hook script.
> >
> 
> Short answer: the mutt concept of "old" conflicts with the maildir
> definition. If you want any maildir flags, your message cannot be in
> new/, which iirc is what mutt means by "not old". You could turn off
> maildir flag synching (but of course that has side effects).

Mutt shows messages without the "S" flag in "cur" as "old", and messages
without the "S" flag in "new" as "new".  Messages with the "S" flag are
shown as read.  This is the default behaviour of mutt.  I don't really
care if this is breaking conventions or not, as this conversation is not
really about mutt at all.

What's so special about the new tags that I'm adding that makes the
unread messages move from "new" to "cur"?  I can *see* them getting
moved when I run the tagging.  Why is notmuch moving them?  The "unread"
tag never changes.

	$ ls "$notmuch_dbdir"/abc/INBOX/new
	1693487404_0.62384.harpo.local,U=352958,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,
	1693488604_2.29495.harpo.local,U=352962,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,
	1693488604_4.29495.harpo.local,U=352964,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,
	1693488604_5.29495.harpo.local,U=352965,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,
	1693488604_6.29495.harpo.local,U=352966,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,
	1693488604_7.29495.harpo.local,U=352967,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,
	1693488604_8.29495.harpo.local,U=352968,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,
	1693489804_0.76572.harpo.local,U=352969,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,
	1693489804_1.76572.harpo.local,U=352970,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,
	1693489804_2.76572.harpo.local,U=352971,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,
	1693489804_3.76572.harpo.local,U=352972,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,
	1693489804_4.76572.harpo.local,U=352973,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,
	1693489804_5.76572.harpo.local,U=352974,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,
	$ notmuch tag +test -- 'path:abc/INBOX/**'
	$ ls "$notmuch_dbdir"/abc/INBOX/new
	(no output)

With

	notmuch search --output=files -- tag:unread and 'path:abc/INBOX/**'

I now see that they were moved into the neighbouring "cur" directory.


-- 
Andreas (Kusalananda) Kähäri
SciLifeLab, NBIS, ICM
Uppsala University, Sweden

.
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: