Skip to content

Commit

Permalink
imap: Don't enforce sending SNIPPET reply as literal
Browse files Browse the repository at this point in the history
Also change it to use "cur_str" since the reply is never very long.
  • Loading branch information
sirainen committed Feb 19, 2018
1 parent c3eb499 commit 2373301
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/imap/imap-fetch-body.c
Expand Up @@ -596,7 +596,6 @@ fetch_snippet(struct imap_fetch_context *ctx, struct mail *mail,
enum mail_lookup_abort temp_lookup_abort = lazy ? MAIL_LOOKUP_ABORT_NOT_IN_CACHE : mail->lookup_abort;
enum mail_lookup_abort orig_lookup_abort = mail->lookup_abort;
const char *snippet;
const char *str;
int ret;

mail->lookup_abort = temp_lookup_abort;
Expand Down Expand Up @@ -625,14 +624,9 @@ fetch_snippet(struct imap_fetch_context *ctx, struct mail *mail,
return 1;
}

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, ")");
str_append(ctx->state.cur_str, "SNIPPET (FUZZY ");
imap_append_string(ctx->state.cur_str, snippet);
str_append(ctx->state.cur_str, ") ");

return 1;
}
Expand Down

0 comments on commit 2373301

Please sign in to comment.