Tagging messages sometimes causes them to be marked as old

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

Date: Thu, 31 Aug 2023 11:17:25 +0200

To: notmuch@notmuchmail.org

Cc:

From: Andreas Kusalananda Kähäri


Greetings from a fairly new notmuch user.

I'm using notmuch 0.37 on OpenBSD.  I tag my incoming mail with a
"post-new" hook shell script that looks like this:

#!/bin/sh

tr -s '\t' ' ' <<'TAG_BATCH' | notmuch tag --batch
+inbox          -- folder:/INBOX/
+sent           -- folder:/Sent/
+trash          -- folder:/Trash/
-archive        -- not folder:/Archive/
-junk           -- not folder:/Junk/
-unsorted       -- not folder:/Unsorted/
TAG_BATCH

This tags the mail correctly in my local mail store, which is
"~/Mail/inboxes" with a subdirectory for each of the five accounts that
I receive mail for (so I have "~/Mail/inboxes/work-account-1/INBOX"
etc.)

However, since I often do notmuch searches on the command line, I'd like
to see what account the search results come from, which I would see if
the messages were tagged with the corresponding account name.

I therefore added tagging like this:

notmuch tag +account-workaccount1 -- 'path:work-account-1/**'

(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.

If anyone could enlighten me as to why this happens, I'd be grateful.
It may be as simple as not understading the search or tag semantics, or
missing some obvious implication of tagging like this.

In my configuration, apart from the initial default things, I have:

[new]
tags=inbox;unread

[maildir]
syncronize_flags=true

[index]
header.List=List-Id

(the "post-new" hook is picked up from the ".notmuch/hooks" directory in the
mail store, so it's not mentioned in the configuration).

-- 
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: