Discard header-only message without a Message-ID line

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2021-01-04 15:57:45 +01:00
parent f8eeb71125
commit 99a4bf4819

View File

@ -123,9 +123,13 @@ int perform_checks(char *filename, struct session_data *sdata, struct data *data
make_digests(sdata, cfg); make_digests(sdata, cfg);
// A normal header is much bigger than 10 bytes. We get here for header-only
// messages without a Message-ID: line. I believe that no such message is valid, and
// it's a reasonable to discard it, and not allowing it to fill up the error directory.
if(sdata->hdr_len < 10){ if(sdata->hdr_len < 10){
syslog(LOG_PRIORITY, "%s: invalid message, hdr_len: %d", filename, sdata->hdr_len); syslog(LOG_PRIORITY, "%s: discarding: a header-only message without a Message-ID line", filename);
return ERR; return ERR_DISCARDED;
} }
int rc = process_message(sdata, parser_state, data, cfg); int rc = process_message(sdata, parser_state, data, cfg);