diff --git a/src/config.h b/src/config.h index f2ef3f9..8d8f0f4 100644 --- a/src/config.h +++ b/src/config.h @@ -14,7 +14,7 @@ #define VERSION "1.1.1-pre" -#define BUILD 898 +#define BUILD 899 #define HOSTID "mailarchiver" diff --git a/src/parser.c b/src/parser.c index 5e3c9c4..6cb4f2e 100644 --- a/src/parser.c +++ b/src/parser.c @@ -452,16 +452,21 @@ } 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); }