From e789d1cd9d717b96599c2d27e9edc5d19a7ab5a0 Mon Sep 17 00:00:00 2001 From: Janos SUTO Date: Thu, 17 Feb 2022 19:32:45 +0100 Subject: [PATCH] Fixed reindex utility Signed-off-by: Janos SUTO --- src/reindex.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/reindex.c b/src/reindex.c index 72ab17da..009f205a 100644 --- a/src/reindex.c +++ b/src/reindex.c @@ -121,6 +121,12 @@ uint64 retrieve_email_by_metadata_id(struct session_data *sdata, struct data *da snprintf(sdata->filename, SMALLBUFSIZE-1, "%s", filename); + struct stat st; + sdata->tot_len = stat(filename, &st) == 0 ? st.st_size : 0; + + sdata->internal_sender = sdata->internal_recipient = sdata->external_recipient = sdata->direction = 0; + memset(sdata->attachments, 0, SMALLBUFSIZE); + state = parse_message(sdata, 1, data, cfg); post_parse(sdata, &state, cfg);