unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Tagging messages sometimes causes them to be marked as old
@ 2023-08-31  9:17 Andreas Kusalananda Kähäri
  2023-08-31 13:24 ` David Bremner
  0 siblings, 1 reply; 7+ messages in thread
From: Andreas Kusalananda Kähäri @ 2023-08-31  9:17 UTC (permalink / raw)
  To: notmuch

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

.\r

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-09-01 12:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-31  9:17 Tagging messages sometimes causes them to be marked as old Andreas Kusalananda Kähäri
2023-08-31 13:24 ` David Bremner
2023-08-31 14:08   ` Andreas Kusalananda Kähäri
2023-09-01  0:39     ` David Bremner
2023-09-01 12:16     ` David Bremner
2023-09-01 12:41       ` Andreas Kusalananda Kähäri
2023-09-01 12:56         ` Andreas Kusalananda Kähäri

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).