}
errstr = mailbox_get_last_error(cmd->client->mailbox, &error);
- if (error == MAIL_ERROR_CONVERSION ||
- error == MAIL_ERROR_INVALIDDATA) {
- /* a) BINARY found unsupported Content-Transfer-Encoding
- b) Content was invalid */
+ if (error == MAIL_ERROR_CONVERSION) {
+ /* BINARY found unsupported Content-Transfer-Encoding */
tagged_reply = t_strdup_printf(
"NO ["IMAP_RESP_CODE_UNKNOWN_CTE"] %s", errstr);
+ } else if (error == MAIL_ERROR_INVALIDDATA) {
+ /* Content was invalid */
+ tagged_reply = t_strdup_printf(
+ "NO ["IMAP_RESP_CODE_PARSE"] %s", errstr);
} else {
/* We never want to reply NO to FETCH requests,
BYE is preferrable (see imap-ml for reasons). */