Between last night and this morning I started to add some extensions to the IMAP client, mostly due the fact that I wanted to take advantage of my existing IMAP server and use it to sort the messages before my web-mail application gets them. So I started with the SORT command, I think this is still in the proposal stages, but it seems to be quite mature and easily implemented.

SORT is really an extension of the SEARCH command, allowing to to search the messages and then return them in a particular order. In the IMAP client the way the code currently works I took the time to check the capabilities and make sure that SORT is listed, if not it then defaults to SEARCH. That way you still get your results, they just aren’t in any defined order.

Along with the SORT command the THREAD command is defined. THREAD=REFERENCES looks most promising as it appears to be the way that Google’s Gmail is able to group email messages into conversations. Now that I know this I am planning on implementing this and adding a threaded email view as an option in my web-mail client.

I’m going to be looking into the other extensions that my existing IMAP server handles and deciding if I wish to implement them now or later. It will depend on how useful I think the extension is and how long I think it will take to implement it.