From: Timo Sirainen Date: Fri, 16 Feb 2018 12:46:36 +0000 (+0200) Subject: imap: Add parenthesis to FETCH SNIPPET (FUZZY text) response X-Git-Tag: 2.3.9~2286 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1fc112d7f357b9c120856d46662423a2d28cbdbb;p=thirdparty%2Fdovecot%2Fcore.git imap: Add parenthesis to FETCH SNIPPET (FUZZY text) response Otherwise it violates the RFC 3501 text about FETCH responses. --- diff --git a/src/imap/imap-fetch-body.c b/src/imap/imap-fetch-body.c index 1325bf0fff..52318b387f 100644 --- a/src/imap/imap-fetch-body.c +++ b/src/imap/imap-fetch-body.c @@ -626,13 +626,14 @@ fetch_snippet(struct imap_fetch_context *ctx, struct mail *mail, return 1; } - str = t_strdup_printf(" SNIPPET FUZZY {%"PRIuSIZE_T"}\r\n", strlen(snippet)); + str = t_strdup_printf(" SNIPPET (FUZZY {%"PRIuSIZE_T"}\r\n", strlen(snippet)); if (ctx->state.cur_first) { str++; ctx->state.cur_first = FALSE; } o_stream_nsend_str(ctx->client->output, str); o_stream_nsend_str(ctx->client->output, snippet); + o_stream_nsend_str(ctx->client->output, ")"); return 1; }