better parsing of multiline subjects

This commit is contained in:
SJ 2015-01-09 12:00:59 +01:00
parent 63339e48c1
commit 66db430f24
2 changed files with 11 additions and 6 deletions

View File

@ -14,7 +14,7 @@
#define VERSION "1.1.1-pre"
#define BUILD 898
#define BUILD 899
#define HOSTID "mailarchiver"

View File

@ -452,15 +452,20 @@ int parse_line(char *buf, struct _state *state, struct session_data *sdata, int
}
else {
p = strrchr(state->b_subject, ' ');
if(p && ( strcasestr(p+1, "?Q?") || strcasestr(p+1, "?B?") ) ){
strncat(state->b_subject, buf+1, MAXBUFSIZE-1);
}
else strncat(state->b_subject, buf, MAXBUFSIZE-1);
/*
* if the next subject line is encoded, then strip the whitespace characters at the beginning of the line
*/
p = buf;
if(strcasestr(buf, "?Q?") || strcasestr(buf, "?B?")){
while(isspace(*p)) p++;
}
strncat(state->b_subject, p, MAXBUFSIZE-1);
}
}
if(state->is_1st_header == 1){
fixupEncodedHeaderLine(buf, MAXBUFSIZE);