unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Andrew Todd <at@auspicacious.org>
To: notmuch@notmuchmail.org
Subject: Difficulty understanding maildir.synchronize_flags behavior
Date: Tue, 12 Dec 2023 18:46:25 +0900	[thread overview]
Message-ID: <8b9ebf16-77f2-4393-954a-42c6075a583c@auspicacious.org> (raw)

Hello,

I'm trying to set up notmuch, and I think that the behavior I want 
should be possible (and is desirable), but I can't seem to make it work. 
I also can't find any reference online suggesting that it *shouldn't* 
work, and I would have thought that it's a very common use case for 
people using multiple mail clients with one IMAP server.

Running Arch Linux, so on latest (currently 0.38.1). Working with the 
CLI and Emacs frontend.

I'm synchronizing mail from a remote IMAP server to local maildir using 
isync/mbsync.

What I want is for messages that do not have maildir files ending in 
':2,S' to be tagged as 'unread' in notmuch.

In other words, I want notmuch to respect the read/unread state of 
messages from the IMAP server and not make any other changes.

My understanding is that this is the purpose of the 
maildir.synchronize_flags option. I have explicitly set this to true in 
my config:

[maildir]
synchronize_flags=true

Moreover, I have also turned off all default tags when running notmuch new:

[new]
tags=

What I see is:

1) When I pull in messages with `mbsync`, they end up in the `new/` 
directory as expected.
2) When I run `notmuch new`, the messages remain in the `new/` 
directory. I guess this is correct. I don't really mind where they are.
3) When I open the Emacs interface, I see that the message is not tagged 
as `unread`. Moreover, when I read the message, it is not moved from 
`new/` to `cur/`, and the filename does not change from ':2,' to ':2,S'.

This is the first part of the problem.

The second part is that when I try to implement tagging in a post-new 
hook, all messages are immediately marked as read, e.g. they are moved 
from `new/` to `cur/` and their filename ending changes from ':2,' to 
':2,S'.

This is the only tag operation I'm performing:

+inbox -- folder:current/Inbox

My understanding of what the behavior should be is that:

1) `notmuch new` should automatically tag messages in `new/` and `cur/` 
that do not have 'S' in their filename as 'unread'.
2) `notmuch tag` should not mark an unread message as read; maybe this 
is happening because `notmuch new` didn't add the `unread` tag beforehand?

On the other hand, I have confirmed that if I go into the emacs 
interface and add the 'unread' tag to messages, their maildir files do 
get the 'S' removed from them. So the tag synchronization is working in 
the opposite direction.

I feel like I must be missing something fundamental in my understanding, 
or there is a fundamental bug in maildir.synchronize_flags. I would 
appreciate any advice.

Thank you,
Andrew Todd
at@auspicacious.org

             reply	other threads:[~2023-12-12  9:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12  9:46 Andrew Todd [this message]
2023-12-12 11:25 ` Difficulty understanding maildir.synchronize_flags behavior Michael J Gruber
2023-12-13  4:38   ` Andrew Todd

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=8b9ebf16-77f2-4393-954a-42c6075a583c@auspicacious.org \
    --to=at@auspicacious.org \
    --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).