[Tickets #10442] Re: Mailbox listing failed: Bad IMAP request: Command Error. 10

bugs at horde.org bugs at horde.org
Sat Aug 20 18:11:01 UTC 2011


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/10442
------------------------------------------------------------------------------
  Ticket             | 10442
  Updated By         | Michael Slusarz <slusarz at horde.org>
  Summary            | Mailbox listing failed: Bad IMAP request: Command
                     | Error. 10
  Queue              | IMP
  Version            | 5.0.9
  Type               | Bug
-State              | Unconfirmed
+State              | Not A Bug
  Priority           | 2. Medium
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


Michael Slusarz <slusarz at horde.org> (2011-08-20 18:11) wrote:

This is a bug/fault in Exchange.  Unfortunately, there is no way to  
work around.

Highlights of log file:

Exchange 2010 does not support SORT:
(1313836978.3636) S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=NTLM  
AUTH=GSSAPI AUTH=PLAIN STARTTLS UIDPLUS CHILDREN IDLE NAMESPACE LITERAL+

Also humorous: Exchange does not support UTF-8 searches either:
(1313836982.3986) C: 7 SEARCH CHARSET UTF-8 BODY a 1
(1313836982.5981) S: 7 NO [BADCHARSET (US-ASCII)] The specified  
charset is not supported.

This is 2010.  It can't be that difficult to have implemented UTF-8 by now...

Because Exchange does not support server side sort, for anything other  
than sequence sort IMP needs to grab the information from the IMAP  
server for all messages in the mailbox to do the requested sort.  In  
your case, the user wants to do a date sort.

So, we first grab the list of UIDs from the mailbox:
(1313836999.1513) C: 4 UID SEARCH ALL
(1313836999.3543) S: * SEARCH 122571 122591 122608 12261 [...and 2092  
other UIDs]

Then we try to fetch the internal date information for all of these messages:

(1313836999.4008) C: 5 UID FETCH 122571,122591,122608,122617,[... and  
2092 other UIDS] (INTERNALDATE)
(1313836999.4020) S: 5 BAD Command Error. 10

[Sidenote: this should be optimized in the IMAP library.  Instead of  
grabbing the list of UIDs and then fetching by this list of UIDs, we  
should instead Fetch all messages in the mailbox (by sequence number),  
and grab the UID during this fetch: XX FETCH 1:* (UID INTERNALDATE).   
This will save a roundtrip to the server.]

Our FETCH command is a perfectly valid command (and not a very  
complicated one at that).  Exchange is throwing a BAD, which according  
to the RFCs means an invalid command or invalid arguments.  But  
instead it looks like it should be throwing a NO instead (fetch error:  
can't fetch that data).

In either case, Exchange is at fault.  Almost certainly it is some  
sort of error in parsing a date string that is specific to one message  
in that user's mailbox that is causing that problem (date parsing is  
notorious for being buggy, since the possible inputs/formats are so  
numerous).





More information about the bugs mailing list