Fixed date header parsing

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2021-10-30 18:40:46 +02:00
parent 535e695c2b
commit aea0cf865d
2 changed files with 2 additions and 3 deletions

View File

@ -441,14 +441,14 @@ int parse_line(char *buf, struct parser_state *state, struct session_data *sdata
if(strstr(buf, "=?") && strstr(buf, "?=")) fixupEncodedHeaderLine(buf, MAXBUFSIZE);
sdata->sent = parse_date_header(buf);
sdata->sent = parse_date_header(buf+5);
/* allow +2 days drift in the parsed Date: value */
if(sdata->sent - sdata->now > 2*86400) sdata->sent = sdata->now;
}
else if(strncasecmp(buf, "Delivery-date:", strlen("Delivery-date:")) == 0 && sdata->delivered == 0) sdata->delivered = parse_date_header(buf);
else if(strncasecmp(buf, "Delivery-date:", strlen("Delivery-date:")) == 0 && sdata->delivered == 0) sdata->delivered = parse_date_header(buf+14);
else if(strncasecmp(buf, "Received:", strlen("Received:")) == 0){
state->message_state = MSG_RECEIVED;
state->received_header++;

View File

@ -126,7 +126,6 @@ time_t parse_date_header(char *datestr){
char *p, *q, *r, *tz, s[SMALLBUFSIZE], tzh[4], tzm[3];
struct tm tm;
datestr += 5;
p = datestr;
for(; *datestr; datestr++){