From 1fc112d7f357b9c120856d46662423a2d28cbdbb Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 16 Feb 2018 14:46:36 +0200 Subject: [PATCH] imap: Add parenthesis to FETCH SNIPPET (FUZZY text) response Otherwise it violates the RFC 3501 text about FETCH responses. --- src/imap/imap-fetch-body.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }