changeset 21496:8cbee0fe11fd

lib-imap, imap: BINARY [UNKNOWNCTE] to [PARSE]
author Martti Rannanjärvi <martti.rannanjarvi@dovecot.fi>
date Mon, 02 May 2016 13:26:05 +0300
parents 5f2cc5e42122
children 1f04b10661cc
files src/imap/cmd-fetch.c src/lib-imap/imap-resp-code.h
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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). */
--- 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