Forcing a sync of maildir flags?

classic Classic list List threaded Threaded
6 messages Options
Sean Whitton Sean Whitton
Reply | Threaded
Open this post in threaded view
|

Forcing a sync of maildir flags?

Hello,

I have this in my post-new hook:

    notmuch tag -unread -- folder:sent

The idea is that copies of my sent mail which get returned to me and
stored in my inbox, e.g. by mailing lists, would get maildir Seen tags
added to them.  But that does not happen.

This works:

    notmuch tag +unread -- folder:sent
    notmuch tag -unread -- folder:sent

Is there some more elegant way to force a sync of maildir flags?  Am I
the only one that has copies of my own mail in my inbox folder, not
marked as read from the point of view of anything except notmuch?

Please CC me on replies.

--
Sean Whitton
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: Forcing a sync of maildir flags?

Sean Whitton <[hidden email]> writes:

> I have this in my post-new hook:
>
>     notmuch tag -unread -- folder:sent
>
> The idea is that copies of my sent mail which get returned to me and
> stored in my inbox, e.g. by mailing lists, would get maildir Seen tags
> added to them.  But that does not happen.

I guess this is most likely a bug. It would be nice to have a test in
T340-maildir-sync.sh that duplicated it. I suspect the problem is
related to messages in the new/ subdirectory. Some non-notmuch clients
(prominently mutt) interpret being in new/ has having user-visible
semantics, so notmuch tries not to move files out of there
unnecessarily, On the other hand the maildir spec says that files in
new/ cannot have flags, so they cannot have their unread tag removed
without moving the file to cur/

> This works:
>
>     notmuch tag +unread -- folder:sent
>     notmuch tag -unread -- folder:sent
>
> Is there some more elegant way to force a sync of maildir flags?  Am I
> the only one that has copies of my own mail in my inbox folder, not
> marked as read from the point of view of anything except notmuch?

I guess my workflow doesn't expose this problem as I leave many messages
unread (relying on the inbox flag). I'm not sure about the locking
implications, but having sent messages delivered to cur/ instead of to
new/ would probably workaround the problem.

d
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: Forcing a sync of maildir flags?

David Bremner <[hidden email]> writes:

>> This works:
>>
>>     notmuch tag +unread -- folder:sent
>>     notmuch tag -unread -- folder:sent
>>
>> Is there some more elegant way to force a sync of maildir flags?  Am I
>> the only one that has copies of my own mail in my inbox folder, not
>> marked as read from the point of view of anything except notmuch?
>
> I guess my workflow doesn't expose this problem as I leave many messages
> unread (relying on the inbox flag). I'm not sure about the locking
> implications, but having sent messages delivered to cur/ instead of to
> new/ would probably workaround the problem.

I guess the other thing is that I have

[new]
tags=unread;inbox;new

in .notmuch-config, which means that "notmuch new" moves things into
cur/. Maybe you can use that effect?

d


_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Sean Whitton Sean Whitton
Reply | Threaded
Open this post in threaded view
|

Re: Forcing a sync of maildir flags?

In reply to this post by David Bremner-2
Hello David,

Thank you for your reply.

On Thu 20 Feb 2020 at 08:22AM -04, David Bremner wrote:

> Sean Whitton <[hidden email]> writes:
>
>> I have this in my post-new hook:
>>
>>     notmuch tag -unread -- folder:sent
>>
>> The idea is that copies of my sent mail which get returned to me and
>> stored in my inbox, e.g. by mailing lists, would get maildir Seen tags
>> added to them.  But that does not happen.
>
> I guess this is most likely a bug. It would be nice to have a test in
> T340-maildir-sync.sh that duplicated it. I suspect the problem is
> related to messages in the new/ subdirectory. Some non-notmuch clients
> (prominently mutt) interpret being in new/ has having user-visible
> semantics, so notmuch tries not to move files out of there
> unnecessarily, On the other hand the maildir spec says that files in
> new/ cannot have flags, so they cannot have their unread tag removed
> without moving the file to cur/

So, your hypothesis is that notmuch is opting not to add the Seen flag
in order to avoid having to move the message from new to cur, for the
sake of mutt, but that's a bug because I've explicitly requested adding
Seen, so it ought to go ahead and move it from new to cur?

>> This works:
>>
>>     notmuch tag +unread -- folder:sent
>>     notmuch tag -unread -- folder:sent
>>
>> Is there some more elegant way to force a sync of maildir flags?  Am I
>> the only one that has copies of my own mail in my inbox folder, not
>> marked as read from the point of view of anything except notmuch?
>
> I guess my workflow doesn't expose this problem as I leave many messages
> unread (relying on the inbox flag). I'm not sure about the locking
> implications, but having sent messages delivered to cur/ instead of to
> new/ would probably workaround the problem.

In this case it's mbsync downloading messages from IMAP, and there
doesn't seem to be a way to configure it to deliver to cur instead of
new.

On Thu 20 Feb 2020 at 09:21AM -04, David Bremner wrote:

> I guess the other thing is that I have
>
> [new]
> tags=unread;inbox;new
>
> in .notmuch-config, which means that "notmuch new" moves things into
> cur/. Maybe you can use that effect?

To be honest that doesn't seem really better than the workaround I'm
currently using.

--
Sean Whitton
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: Forcing a sync of maildir flags?

Sean Whitton <[hidden email]> writes:

> So, your hypothesis is that notmuch is opting not to add the Seen flag
> in order to avoid having to move the message from new to cur, for the
> sake of mutt, but that's a bug because I've explicitly requested adding
> Seen, so it ought to go ahead and move it from new to cur?

Yeah, I think that's the case. This is based only vague memories of when
I wrote 0082a557.

d
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Sean Whitton Sean Whitton
Reply | Threaded
Open this post in threaded view
|

Re: Forcing a sync of maildir flags?

Hello,

On Thu 20 Feb 2020 at 08:06PM -04, David Bremner wrote:

> Sean Whitton <[hidden email]> writes:
>
>> So, your hypothesis is that notmuch is opting not to add the Seen flag
>> in order to avoid having to move the message from new to cur, for the
>> sake of mutt, but that's a bug because I've explicitly requested adding
>> Seen, so it ought to go ahead and move it from new to cur?
>
> Yeah, I think that's the case. This is based only vague memories of when
> I wrote 0082a557.

Thanks.  Let me record in this thread what I will believe it will take a
reproduce this in a test:

1) inbox and sent are Maildirs

1) Compose mail to a mailing list which will return copies of
   submissions, with `Fcc: sent -unread`

2) notmuch new, and in post-new hook, notmuch tag -unread -- folder:sent

Expected result: copy of message in both inbox and sent has Seen flag

Actual result: only copy of message in sent has Seen flag

--
Sean Whitton
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch