Searching Messages

Make sure you're able to handle multiple SEARCH replies returning messages non-ordered:

1 UID SEARCH ALL
* SEARCH 5 2
* SEARCH 1 3
1 OK

When searching non-ASCII text, you'll have to specify CHARSET parameter. There is no way to list supported charsets, but you do get a [BADCHARSET] tag if the used charset isn't supported. So you can only guess. UTF-8 should be supported by all servers nowadays, and there probably isn't much point in trying to guess any others.