early decoding of utf/qp/... encoded attachment filenames

This commit is contained in:
SJ 2012-12-09 23:14:39 +01:00
parent 13534576df
commit eeeb3fbad8
2 changed files with 3 additions and 2 deletions

View File

@ -13,7 +13,7 @@
#define VERSION "0.1.23-master-branch" #define VERSION "0.1.23-master-branch"
#define BUILD 739 #define BUILD 741
#define HOSTID "mailarchiver" #define HOSTID "mailarchiver"

View File

@ -128,7 +128,6 @@ void post_parse(struct session_data *sdata, struct _state *state, struct __confi
for(i=1; i<=state->n_attachments; i++){ for(i=1; i<=state->n_attachments; i++){
digest_file(state->attachments[i].internalname, &(state->attachments[i].digest[0])); 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); 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){ if(take_into_pieces == 1){
state->fd = open(state->attachments[state->n_attachments].internalname, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR); 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); p = get_attachment_extractor_by_filename(state->attachments[state->n_attachments].filename);
snprintf(state->attachments[state->n_attachments].shorttype, TINYBUFSIZE-1, "%s", p); snprintf(state->attachments[state->n_attachments].shorttype, TINYBUFSIZE-1, "%s", p);