From c2e7a94b4e7a2310295d9ad675546f95920a6fda Mon Sep 17 00:00:00 2001 From: SJ Date: Thu, 5 May 2016 21:13:45 +0200 Subject: [PATCH] fixing spam header recognition Signed-off-by: SJ --- src/config.h | 2 +- src/parser.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/config.h b/src/config.h index ca25a1cf..8665832a 100644 --- a/src/config.h +++ b/src/config.h @@ -13,7 +13,7 @@ #define VERSION "1.2.0-master" -#define BUILD 942 +#define BUILD 943 #define HOSTID "mailarchiver" diff --git a/src/parser.c b/src/parser.c index 7e38b0fb..feef1843 100644 --- a/src/parser.c +++ b/src/parser.c @@ -197,10 +197,6 @@ int parse_line(char *buf, struct parser_state *state, struct session_data *sdata sdata->restored_copy = 1; } - if(*(cfg->spam_header_line) != '\0' && strncmp(buf, cfg->spam_header_line, strlen(cfg->spam_header_line)) == 0){ - sdata->spam_message = 1; - } - if(sdata->ms_journal == 0 && (strncmp(buf, "X-MS-Journal-Report:", strlen("X-MS-Journal-Report:")) == 0 || (sdata->import == 1 && strncmp(buf, "X-MS-Exchange-Organization-Auth", strlen("X-MS-Exchange-Organization-Auth")) == 0))){ if(sdata->import == 0){ sdata->ms_journal = 1; @@ -347,6 +343,10 @@ int parse_line(char *buf, struct parser_state *state, struct session_data *sdata if(state->is_header == 1){ + if(*(cfg->spam_header_line) != '\0' && strncmp(buf, cfg->spam_header_line, strlen(cfg->spam_header_line)) == 0){ + sdata->spam_message = 1; + } + if(strncasecmp(buf, "From:", strlen("From:")) == 0) state->message_state = MSG_FROM; else if(strncasecmp(buf, "Content-Type:", strlen("Content-Type:")) == 0){