#3966: IMAP delete unread message
---------------------+---------------------
Reporter: anton | Owner: brendan
Type: defect | Status: new
Priority: major | Milestone:
Component: IMAP | Version:
Resolution: | Keywords:
---------------------+---------------------
Comment (by anton):
> Thank you for the excellent bug report. This is reproducible in 1.8.3
and
> is the result of the "fix" in changeset:323e3d6e5e4c for ticket 3860. I
> swear I remember testing that better, but I can easily reproduce the
> problem. My apologies.
No worries, my current work-around is to issue a sync of the mailbox
prior deleting. That we the read flag will already be in sync.
> I'll take a look at a few possible fixes. At the worst I'll just remove
> the "/Seen" syncing for 1.9.1 if other fixes are too involved, and try
to
> fix it properly for the next major release.
Great! If you need any help or me trying out diffs just let me know. I'm
willing to look further into this with some guidance.
Another related gotcha: the communication enclosed in my initial report
was from FastMail. I tried to reproduce the same bug using Gmail without
luck (guess it's actually a good thing :-)). Turns out the unanticipated
FETCH is ignored since the format of response is differs:
{{{
# FastMail
4< * 6 FETCH (FLAGS (\Seen $X-ME-Annot-2) UID 80)
Handling FETCH
Message UID 80 updated
# Gmail
4< * 2 FETCH (UID 85046 FLAGS (\Seen))
Handling FETCH
Message UID 85046 updated
Only handle FLAGS updates
}}}
Since `FETCH (` is not immediately followed by `FLAGS` the response is
ignored. My knowledge of the IMAP-protocol is limited but if the server
is free to arrange the items in the response I guess a check like one
below would be more appropriate:
{{{
diff -r 0e0a4b7e9dd1 imap/command.c
--- a/imap/command.c Tue Sep 05 17:33:45 2017 +0200
+++ b/imap/command.c Mon Sep 11 21:18:43 2017 +0200
@@ -680,7 +680,7 @@
}
s++;
- if (ascii_strncasecmp ("FLAGS", s, 5) != 0)
+ if (strstr (s, "FLAGS") == NULL)
{
dprint (2, (debugfile, "Only handle FLAGS updates\n"));
return;
}}}
--
Ticket URL: <https://dev.mutt.org/trac/ticket/3966#comment:2>
Mutt <http://www.mutt.org/>
The Mutt mail user agent