imap: Code cleanup and error handling fixes for CATENATE
imap: Code cleanup and error handling fixes for CATENATE

Distrotech/dovecot,Distrotech/dovecot,Distrotech/dovecot,Distrotech/dovecot,Distrotech/dovecot