I ended up capturing the network traffic of one of these sessions and found this:
RC sends: "s SORT (DATE) US-ASCII ALL " (note the trailing space) Server responds: "s BAD Invalid Search criteria."
Unlike when I tested manually, the command fails. It turns out to be due to the trailing space(!).
I've attached a patch for this part of the problem.
(Changes $command = 's SORT ('.$field.') US-ASCII ALL '."$add\r\n"; to $command = 's SORT ('.$field.') US-ASCII ALL'.($add?' ':'')."$add\r\n";)
But now I get a blank page (quickly!) and the following in logs/errors:
[21-Apr-2006 00:31:28] PHP Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 35 bytes) in /shares/www/webmail.foo.bar/roundcubetest/program/include/rcube_imap.inc on line 786
Is there any way of making RC consume less memory while doing this?
/Håkan Lindqvist