mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-24 19:30:12 +01:00
better parsing of multiline subjects
This commit is contained in:
parent
63339e48c1
commit
66db430f24
@ -14,7 +14,7 @@
|
||||
|
||||
#define VERSION "1.1.1-pre"
|
||||
|
||||
#define BUILD 898
|
||||
#define BUILD 899
|
||||
|
||||
#define HOSTID "mailarchiver"
|
||||
|
||||
|
15
src/parser.c
15
src/parser.c
@ -452,16 +452,21 @@ 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);
|
||||
/*
|
||||
* 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++;
|
||||
}
|
||||
else strncat(state->b_subject, buf, MAXBUFSIZE-1);
|
||||
|
||||
strncat(state->b_subject, p, MAXBUFSIZE-1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(state->is_1st_header == 1){
|
||||
fixupEncodedHeaderLine(buf, MAXBUFSIZE);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user