# HG changeset patch # User Martti Rannanjärvi # Date 1462184765 -10800 # Node ID 8cbee0fe11fdf836eb788cab90a23bf43c8c3c73 # Parent 5f2cc5e42122f4a71216e5cd1dd23caeddbbf13b lib-imap, imap: BINARY [UNKNOWNCTE] to [PARSE] diff -r 5f2cc5e42122 -r 8cbee0fe11fd src/imap/cmd-fetch.c --- a/src/imap/cmd-fetch.c Sun Feb 05 16:24:08 2017 +0200 +++ b/src/imap/cmd-fetch.c Mon May 02 13:26:05 2016 +0300 @@ -209,12 +209,14 @@ } 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). */ diff -r 5f2cc5e42122 -r 8cbee0fe11fd src/lib-imap/imap-resp-code.h --- a/src/lib-imap/imap-resp-code.h Sun Feb 05 16:24:08 2017 +0200 +++ b/src/lib-imap/imap-resp-code.h Mon May 02 13:26:05 2016 +0300 @@ -22,4 +22,7 @@ #define IMAP_RESP_CODE_UNKNOWN_CTE "UNKNOWN-CTE" /* BINARY */ +/* IMAP standard (RFC 3501) */ +#define IMAP_RESP_CODE_PARSE "PARSE" + #endif