IMAP client and server implementation