Fix issue with IMAP failure on getting emails