From a9f5562f635a7398341ef28898061c2590c82ba5 Mon Sep 17 00:00:00 2001 From: Janos SUTO Date: Sat, 24 Jul 2021 12:39:53 +0200 Subject: [PATCH] Fixed message/rfc822 parsing Signed-off-by: Janos SUTO --- src/parser.c | 4 +++- src/test.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/parser.c b/src/parser.c index 7b1ea688..75432d51 100644 --- a/src/parser.c +++ b/src/parser.c @@ -134,7 +134,7 @@ void post_parse(struct session_data *sdata, struct parser_state *state, struct c digest_file(state->attachments[i].internalname, &(state->attachments[i].digest[0])); - if(cfg->verbosity >= _LOG_DEBUG) syslog(LOG_PRIORITY, "%s: attachment list: i:%d, name=*%s*, type: *%s*, size: %d, int.name: %s, digest: %s", sdata->ttmpfile, i, state->attachments[i].filename, state->attachments[i].type, state->attachments[i].size, state->attachments[i].internalname, state->attachments[i].digest); + if(cfg->verbosity >= _LOG_DEBUG) syslog(LOG_PRIORITY, "%s: attachment list: i:%d, name=*%s*, type: *%s*, size: %d, int.name: %s, digest: %s, dumped: %d", sdata->ttmpfile, i, state->attachments[i].filename, state->attachments[i].type, state->attachments[i].size, state->attachments[i].internalname, state->attachments[i].digest, state->attachments[i].dumped); char *p = determine_attachment_type(state->attachments[i].filename, state->attachments[i].type); len = strlen(p); @@ -571,6 +571,8 @@ int parse_line(char *buf, struct parser_state *state, struct session_data *sdata state->message_rfc822 = 1; state->is_header = 1; + state->has_to_dump = 0; + if(sdata->ms_journal == 1){ state->is_1st_header = 1; diff --git a/src/test.c b/src/test.c index 0049a41e..1dc79193 100644 --- a/src/test.c +++ b/src/test.c @@ -183,7 +183,7 @@ int main(int argc, char **argv){ clearhash(data.mydomains); for(i=1; i<=state.n_attachments; i++){ - printf("i:%d, name=*%s*, type: *%s*, size: %d, int.name: %s, digest: %s\n", i, state.attachments[i].filename, state.attachments[i].type, state.attachments[i].size, state.attachments[i].internalname, state.attachments[i].digest); + printf("i:%d, name=*%s*, type: *%s*, size: %d, int.name: %s, dumped: %d, digest: %s\n", i, state.attachments[i].filename, state.attachments[i].type, state.attachments[i].size, state.attachments[i].internalname, state.attachments[i].dumped, state.attachments[i].digest); unlink(state.attachments[i].internalname); }