Best Practices for Implementing an IMAP Client