Merge pull request #1 from mystichacker/develop

Ensure imap connection is disconnected
Rework imap connection resilience