more comprehensive exception handling on all imap interactions