muchsync files renames

Amadeusz Żołnowski aidecoe at aidecoe.name
Tue Sep 1 15:52:37 PDT 2015


Hi David,

David Mazieres <dm-list-email-notmuch at scs.stanford.edu> writes:
> Let's just make sure I understand:  Your mail starts out like this:
>
>     Path:  spam/new/nnn.MnnnPnnnQnRn.machine
>     Tags:  new
>
> Then you run afew, and afew runs
>
>     notmuch tag -new +spam <message-ID>
>
> You are saying that that even though maildir.synchronize_tags is true,
> you end up with:
>
>     Path:  spam/new/nnn.MnnnPnnnQnRn.machine
>     Tags:  spam

Yes.


> That's a little surprising, because the next time you run "notmuch new,"
> I would have expected it to add the unread flag based on the pathname.

What's more surprising is that there is a test case in notmuch test
suite which test whether after modifing tag of a mail it is moved from
new/ to cur/. Yes, it should be moved on any tag modification if I
understand correctly. But it seems it does not for my maildirs...

$ notmuch search --output=files thread:00000000000108bf
/home/aidecoe/Mail/aidecoe/2015/new/1441022521.M714465P23412V000000000000FE04I0000000000141A38_0.freja,S=53857
$ notmuch search thread:00000000000108bf
thread:00000000000108bf  Yest. 11:58 [1/1] Somebody; Subject (reklama unread)
$ notmuch tag +hey thread:00000000000108bf
$ notmuch search thread:00000000000108bf
thread:00000000000108bf  Yest. 11:58 [1/1] Somebody; Subject (hey reklama unread)
$ notmuch search --output=files thread:00000000000108bf
/home/aidecoe/Mail/aidecoe/2015/new/1441022521.M714465P23412V000000000000FE04I0000000000141A38_0.freja,S=53857


> Then it will add the unread tag to the Xapian database.  But maybe if it
> finds a file in the new folder it doesn't add the unread flag.

Might be.


> But why does notmuch_message_tags_to_maildir_flag() then feel the need
> to rename the file when muchsync calls it.  Muchsync should ideally
> behave exactly the same as the notmuch tag command.  Specifically, when
> muchsync receives a new file from the server, it does the following:
>
>  1. create file in same directory as the server (presumably spam/new)
>
>  2. Call the following functions on this file:
>       notmuch_database_add_message()
>       notmuch_message_freeze()
>       notmuch_message_remove_all_tags()
>       notmuch_message_add_tag() for each tag in new.tags
>       if (synchronize_tags) notmuch_message_tags_to_maildir_flag()
>       notmuch_message_thaw()
>
>  3. get the current tags of the message from the server (presumably just
>     spam)
>
>  4. Call the following functions on the Message-ID:
>       notmuch_message_freeze()
>       notmuch_message_remove_all_tags()
>       notmuch_message_add_tag() for each tag sent *by the server*
>       if (synchronize_tags) notmuch_message_tags_to_maildir_flag()
>       notmuch_message_thaw()

So for some reason in my maildirs mails are not moved from new/ to cur/
on tag manipulation, but they are on client side by muchsync.  I will
have to investigate why this happens to me.


-- 
Amadeusz Żołnowski
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 950 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20150901/24601ca4/attachment.sig>


More information about the notmuch mailing list