Not sure that you understand hmailserver supports imap sort messages, the settings are stored in mysql myroundcube very good, there is no such thing as a simple sorting