From dd2ea801bf7817348c826210f26c3584de8c66e8 Mon Sep 17 00:00:00 2001 From: SJ Date: Mon, 13 Jan 2014 13:06:10 +0100 Subject: [PATCH] fixing an odd exchange behaviour --- src/config.h | 2 +- src/defs.h | 1 + src/import.c | 2 ++ src/misc.c | 1 + src/parser.c | 2 +- src/piler.c | 1 + src/reindex.c | 1 + 7 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/config.h b/src/config.h index 0451a43e..525e19fb 100644 --- a/src/config.h +++ b/src/config.h @@ -14,7 +14,7 @@ #define VERSION "0.1.25-master-branch" -#define BUILD 856 +#define BUILD 857 #define HOSTID "mailarchiver" diff --git a/src/defs.h b/src/defs.h index 8d4e6aa7..99a23c69 100644 --- a/src/defs.h +++ b/src/defs.h @@ -199,6 +199,7 @@ struct session_data { char digest[2*DIGEST_LENGTH+1]; time_t now, sent, delivered, retained; char ms_journal; + char import; int journal_envelope_length, journal_bottom_length; #ifdef NEED_MYSQL MYSQL mysql; diff --git a/src/import.c b/src/import.c index 6e79d965..a3c8b27b 100644 --- a/src/import.c +++ b/src/import.c @@ -69,6 +69,8 @@ int import_message(char *filename, struct session_data *sdata, struct __data *da sdata->sent = 0; sdata->delivered = 0; + sdata->import = 1; + state = parse_message(sdata, 1, data, cfg); post_parse(sdata, &state, cfg); diff --git a/src/misc.c b/src/misc.c index 5c381262..5e72d109 100644 --- a/src/misc.c +++ b/src/misc.c @@ -471,6 +471,7 @@ void init_session_data(struct session_data *sdata, struct __config *cfg){ sdata->__acquire = sdata->__parsed = sdata->__av = sdata->__store = sdata->__compress = sdata->__encrypt = 0; + sdata->import = 0; for(i=0; ircptto[i], 0, SMALLBUFSIZE); diff --git a/src/parser.c b/src/parser.c index b336baa4..9e88ffaf 100644 --- a/src/parser.c +++ b/src/parser.c @@ -186,7 +186,7 @@ int parse_line(char *buf, struct _state *state, struct session_data *sdata, int sdata->spam_message = 1; } - if(state->is_1st_header == 1 && sdata->ms_journal == 0 && (strncmp(buf, "X-MS-Journal-Report:", strlen("X-MS-Journal-Report:")) == 0 || strncmp(buf, "X-MS-Exchange-Organization-Auth", strlen("X-MS-Exchange-Organization-Auth")) == 0)){ + if(state->is_1st_header == 1 && 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))){ sdata->ms_journal = 1; memset(state->message_id, 0, SMALLBUFSIZE); diff --git a/src/piler.c b/src/piler.c index 4623c8af..7e3adcd4 100644 --- a/src/piler.c +++ b/src/piler.c @@ -318,6 +318,7 @@ void initialise_configuration(){ data.folder = 0; data.recursive_folder_names = 0; + inithash(data.mydomains); initrules(data.archiving_rules); initrules(data.retention_rules); diff --git a/src/reindex.c b/src/reindex.c index 7e90ce16..109ada85 100644 --- a/src/reindex.c +++ b/src/reindex.c @@ -217,6 +217,7 @@ int main(int argc, char **argv){ data.folder = 0; data.recursive_folder_names = 0; + inithash(data.mydomains); initrules(data.archiving_rules); initrules(data.retention_rules);