Thank you for the links, I'll look into Sup
SMTP was a piece of cake (apart from a weird SSL bug, which took up the majority of my time), but IMAP does look significantly trickier from the RFC
I would love to be in a place where IMAP isn't needed, and I plan to use my own API's for the client applications
Thank you for the code, in any case, it looks like a good laugh to read :D