Skip to content

Commit

Permalink
lib-imap, imap: BINARY [UNKNOWNCTE] to [PARSE]
Browse files Browse the repository at this point in the history
  • Loading branch information
mrannanj authored and GitLab committed May 3, 2016
1 parent 38a985c commit ff17313
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/imap/cmd-fetch.c
Expand Up @@ -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). */
Expand Down
3 changes: 3 additions & 0 deletions src/lib-imap/imap-resp-code.h
Expand Up @@ -22,4 +22,7 @@

#define IMAP_RESP_CODE_UNKNOWN_CTE "UNKNOWN-CTE" /* BINARY */

/* IMAP standard (RFC 3501) */
#define IMAP_RESP_CODE_PARSE "PARSE"

#endif

0 comments on commit ff17313

Please sign in to comment.