]> 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>
Fri, 16 Feb 2018 13:22:52 +0000 (15:22 +0200)
Otherwise it violates the RFC 3501 text about FETCH responses.

src/imap/imap-fetch-body.c

index 1325bf0fff708dfc01eab0287957dbad076d7166..52318b387f26abb607016ad239d18729faa31f72 100644 (file)
@@ -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;
 }