unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: "Andreas Kusalananda Kähäri" <andreas.kahari@abc.se>
To: notmuch@notmuchmail.org
Subject: Tagging messages sometimes causes them to be marked as old
Date: Thu, 31 Aug 2023 11:17:25 +0200	[thread overview]
Message-ID: <ZPBapfF7X5gzPLak@harpo.local> (raw)

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

             reply	other threads:[~2023-08-31  9:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-31  9:17 Andreas Kusalananda Kähäri [this message]
2023-08-31 13:24 ` Tagging messages sometimes causes them to be marked as old 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZPBapfF7X5gzPLak@harpo.local \
    --to=andreas.kahari@abc.se \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).