imap: Introduced IMAP_APPEND and IMAP_APPEND_FINAL states