Fixes for imap handling and fix for status action