]> 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)
committerGitLab <gitlab@git.dovecot.net>
Tue, 3 May 2016 16:46:59 +0000 (19:46 +0300)
src/imap/cmd-fetch.c
src/lib-imap/imap-resp-code.h

index 8f56e4805974339db27f12bccce2bb73ec1de5dc..a574e2dfd2fa41d0009c740811513d7cdb7b936a 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