<<< Date Index >>>     <<< Thread Index >>>

imap/2365: mutt does not accept reordered imap responses



>Number:         2365
>Notify-List:    
>Category:       imap
>Synopsis:       mutt does not accept reordered imap responses
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    mutt-dev
>State:          open
>Keywords:       
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 19 12:43:00 +0200 2006
>Originator:     Arnt Gulbrandsen
>Release:        
>Organization:
>Environment:
>Description:
Mutt, in some circumstances, sends multiple IMAP commands at the same time. For 
example, when I press 'q' to quit, it can send STORE commands to set the \seen 
and \answered flags on two sets of messages.

The IMAP server may execute those two commands concurrently, according to RFC 
3501 section 5.5, but mutt cannot handle that, and hangs.

Here's an example from a connection dump. Mutt sends:
a0114 UID STORE 
28343,29795,29829,29863,29876,30102,30105:30125,30132:30189,30236:30354,30366:30369,30373:30426,30467:30469,30486:30543,30643:30702,30708,30720:30765,30772,30776,30778:30788,30835,30857:30917,30919:30920,31035:31036,31096:31104,31111:31141,31143:31147
 +FLAGS.SILENT (\Seen)
a0115 UID STORE 30102,30109 +FLAGS.SILENT (\Answered)

The IMAP server answers:
a0115 OK done
a0114 OK done

Mutt hangs on this pair of responses.
>How-To-Repeat:
I can provide access to an IMAP server which executes commands concurrently 
(when protocol and implementation allows it).

The easiest way to repeat is to set the seen flag on dozens of messages, answer 
a single message, and quit. The second store command almost always finishes 
before the first.
>Fix:
When several commands are sent at once, accept the OK responses in any order, 
instead of insisting on a specific order.
>Add-To-Audit-Trail:

>Unformatted: