Work towards properly working IMAP integration