Hi!
I know the topic of IMAP sorting has sort of died down, but I'm still having a problem with it. I'm using hMailServer on Windows. Here's what appears to be happening in the IMAP conversation:
"RECEIVED: cp01 CAPABILITY" "SENT: * CAPABILITY IMAP4 IMAP4rev1 QUOTA SORT[nl]cp01 OK CAPABILITY completed[nl]" "RECEIVED: a001 LOGIN my@email.com "password"" "SENT: a001 OK LOGIN completed[nl]" "RECEIVED: sel1 SELECT "INBOX"" "SENT: * 44 EXISTS[nl]* 0 RECENT[nl]* FLAGS (\Deleted \Seen \Draft \Answered \Flagged)[nl]* OK [UIDVALIDITY 0][nl]* OK [PERMANENTFLAGS (\Deleted \Seen \Draft \Answered \Flagged)][nl]sel1 OK [READ-WRITE] SELECT completed[nl]" "RECEIVED: srch1 SEARCH ALL UNDELETED" "SENT: * SEARCH 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44[nl]srch1 OK Search completed[nl]" "RECEIVED: s SORT (DATE) US-ASCII ALL UNDELETED" "SENT: s BAD Unknown or NULL command[nl]"
RoundCube then resorts to sorting the messages itself... I guess the question is.. why is Roundcube sending "s SORT (DATE)..."? What is this 's'?
Is anyone else having this problem? I looked in the code at imap.inc and I think the related code is around line 653:
$command = 's '. $is_uid .'SORT ('.$field.') '.$encoding.' ALL'."$add\r\n";
Any help getting this resolved would be greately appreciated!
Andrew
Hi Andrew,
RoundCube then resorts to sorting the messages itself... I guess
the question is.. why is Roundcube sending "s SORT (DATE)..."?
What is this 's'?
The 's' is a tag. All commands sent from the client to the server
start with a tag specified by the client. All responses to that
command will have the same tag, so the client can keep track of which
command the server is responding to. In this case, RC is using the
unimaginative tag 's' to designate its sort commands.
RFC 3501 says it better: http://www.apps.ietf.org/rfc/rfc3501.html#sec-2.2.1
The 's' is valid syntax, so it's not causing the BAD response. Hope
this helps direct your investigation =]
-joe