]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-imap, imap: BINARY [UNKNOWNCTE] to [PARSE]
authorMartti Rannanjärvi <martti.rannanjarvi@dovecot.fi>
Mon, 2 May 2016 10:26:05 +0000 (13:26 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 6 Feb 2017 14:38:48 +0000 (16:38 +0200)
src/imap/cmd-fetch.c
src/lib-imap/imap-resp-code.h

index da61673beec0015a87db0ce4eb73eafc52f2a8d5..e8baf28bd28c069575b733a420857355ab691b91 100644 (file)
@@ -209,12 +209,14 @@ static bool cmd_fetch_finish(struct imap_fetch_context *ctx,
                }
 
                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). */
index 063c2e5d8b872c3bec707b32b67c82de5592bfa2..a7a4de8c5d5c9d8a92dd88c6eddd491589e0ba7e 100644 (file)
@@ -22,4 +22,7 @@
 
 #define IMAP_RESP_CODE_UNKNOWN_CTE "UNKNOWN-CTE" /* BINARY */
 
+/* IMAP standard (RFC 3501) */
+#define IMAP_RESP_CODE_PARSE "PARSE"
+
 #endif