Mercurial > dovecot > core-2.2
changeset 22868:5841256dd8c7
doveadm dump: Show body.snippet in human-readable form
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Mon, 19 Feb 2018 15:38:13 +0200 |
parents | 334fc7c1e9ee |
children | 98386299bd70 |
files | src/doveadm/doveadm-dump-index.c |
diffstat | 1 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/doveadm/doveadm-dump-index.c Thu Feb 15 18:16:15 2018 +0200 +++ b/src/doveadm/doveadm-dump-index.c Mon Feb 19 15:38:13 2018 +0200 @@ -511,6 +511,16 @@ dump_message_part(str, part); } +static void +dump_cache_snippet(string_t *str, const unsigned char *data, unsigned int size) +{ + if (size == 0) + return; + str_printfa(str, " (version=%u: ", data[0]); + str_append_n(str, data+1, size-1); + str_append_c(str, ')'); +} + static void dump_cache(struct mail_cache_view *cache_view, unsigned int seq) { struct mail_cache_lookup_iterate_ctx iter; @@ -555,6 +565,8 @@ str_printfa(str, "(%s)", binary_to_hex(data, size)); if (strcmp(field->name, "mime.parts") == 0) dump_cache_mime_parts(str, data, size); + else if (strcmp(field->name, "body.snippet") == 0) + dump_cache_snippet(str, data, size); break; case MAIL_CACHE_FIELD_STRING: if (size > 0)