Properly stop imap at logout
Merge remote-tracking branch 'chiiph/bug/properly_stop_imap' into develop