truncate extremely long from address and message_id

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2018-03-03 11:20:55 +01:00
parent 2cfd5ece53
commit 553d7e92c0

View File

@ -69,6 +69,13 @@ void post_parse(struct session_data *sdata, struct parser_state *state, struct c
clearhash(state->rcpt_domain);
clearhash(state->journal_recipient);
// Fix From: line if it's too long
if(strlen(state->b_from) > 255) state->b_from[255] = '\0';
if(strlen(state->b_from_domain) > 255) state->b_from_domain[255] = '\0';
// Truncate the message_id if it's >255 characters
if(strlen(state->message_id) > 255) state->message_id[255] = '\0';
fixupEncodedHeaderLine(state->b_subject, MAXBUFSIZE);
trimBuffer(state->b_subject);