]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Add parenthesis to FETCH SNIPPET (FUZZY text) response
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 16 Feb 2018 12:46:36 +0000 (14:46 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 19 Feb 2018 11:37:44 +0000 (13:37 +0200)
Otherwise it violates the RFC 3501 text about FETCH responses.

src/imap/imap-fetch-body.c

index 5b8203d8dff74ccfda21cdf0e10f849073bf9066..1456d024fe706976d14a146fa1c8a2c7515f0a29 100644 (file)
@@ -625,13 +625,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;
 }