From eeeb3fbad8916f5298aebc38fc30f29bf70528d7 Mon Sep 17 00:00:00 2001 From: SJ Date: Sun, 9 Dec 2012 23:14:39 +0100 Subject: [PATCH] early decoding of utf/qp/... encoded attachment filenames --- src/config.h | 2 +- src/parser.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/config.h b/src/config.h index f37fdeac..100cec99 100644 --- a/src/config.h +++ b/src/config.h @@ -13,7 +13,7 @@ #define VERSION "0.1.23-master-branch" -#define BUILD 739 +#define BUILD 741 #define HOSTID "mailarchiver" diff --git a/src/parser.c b/src/parser.c index 323053a0..d50e1ae1 100644 --- a/src/parser.c +++ b/src/parser.c @@ -128,7 +128,6 @@ void post_parse(struct session_data *sdata, struct _state *state, struct __confi for(i=1; i<=state->n_attachments; i++){ digest_file(state->attachments[i].internalname, &(state->attachments[i].digest[0])); - fixupEncodedHeaderLine(state->attachments[i].filename); 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); @@ -272,6 +271,8 @@ int parse_line(char *buf, struct _state *state, struct session_data *sdata, int if(take_into_pieces == 1){ state->fd = open(state->attachments[state->n_attachments].internalname, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR); + fixupEncodedHeaderLine(state->attachments[state->n_attachments].filename); + p = get_attachment_extractor_by_filename(state->attachments[state->n_attachments].filename); snprintf(state->attachments[state->n_attachments].shorttype, TINYBUFSIZE-1, "%s", p);