till wrote:
Sweet, or good to know! :-)
@alec If an imapd doesn't support this (yet), what's gonna happen? ;-)
If IMAP server doesn't support SORT at all, just SEARCH command will be used like before (with big memory consumption, but it can be (partially) fixed in way that I'm proposed in comments). There may be problem if IMAP server does support SORT but doesn't support searching in SORT. I don't know such server.