diff --git a/src/import.c b/src/import.c index 125796ab..9325e075 100644 --- a/src/import.c +++ b/src/import.c @@ -73,7 +73,7 @@ int import_message(struct session_data *sdata, struct data *data, struct config state = parse_message(sdata, 1, data, cfg); post_parse(sdata, &state, cfg); - rule = check_againt_ruleset(data->archiving_rules, &state, sdata->tot_len, sdata->spam_message); + rule = check_against_ruleset(data->archiving_rules, &state, sdata->tot_len, sdata->spam_message); if(rule){ if(data->quiet == 0) printf("discarding %s by archiving policy: %s\n", data->import->filename, rule); diff --git a/src/mysql.c b/src/mysql.c index 423c69fd..3899c7eb 100644 --- a/src/mysql.c +++ b/src/mysql.c @@ -19,7 +19,7 @@ int open_database(struct session_data *sdata, struct config *cfg){ mysql_options(&(sdata->mysql), MYSQL_OPT_RECONNECT, (const char*)&rc); if(mysql_real_connect(&(sdata->mysql), cfg->mysqlhost, cfg->mysqluser, cfg->mysqlpwd, cfg->mysqldb, cfg->mysqlport, cfg->mysqlsocket, 0) == 0){ - printf("cant connect to mysql server\n"); + syslog(LOG_PRIORITY, "cant connect to mysql server"); return ERR; } diff --git a/src/piler.c b/src/piler.c index f334e5df..d0aa3310 100644 --- a/src/piler.c +++ b/src/piler.c @@ -131,6 +131,7 @@ int process_email(char *filename, struct session_data *sdata, struct data *data, snprintf(sdata->filename, SMALLBUFSIZE-1, "%s", filename); parser_state = parse_message(sdata, 1, data, cfg); + post_parse(sdata, &parser_state, cfg); if(cfg->syslog_recipients == 1){ @@ -144,8 +145,7 @@ int process_email(char *filename, struct session_data *sdata, struct data *data, } while(rcpt); } - - arule = check_againt_ruleset(data->archiving_rules, &parser_state, sdata->tot_len, sdata->spam_message); + arule = check_against_ruleset(data->archiving_rules, &parser_state, sdata->tot_len, sdata->spam_message); if(arule){ syslog(LOG_PRIORITY, "%s: discarding: archiving policy: *%s*", filename, arule); @@ -506,6 +506,7 @@ int main(int argc, char **argv){ initrules(data.retention_rules); initrules(data.folder_rules); data.dedup = MAP_FAILED; + data.import = NULL; initialise_configuration(); diff --git a/src/rules.c b/src/rules.c index eea367aa..6cb40b5b 100644 --- a/src/rules.c +++ b/src/rules.c @@ -228,7 +228,7 @@ int count_match(struct rule *p, struct parser_state *state, int size, int spam){ } -char *check_againt_ruleset(struct node *xhash[], struct parser_state *state, int size, int spam){ +char *check_against_ruleset(struct node *xhash[], struct parser_state *state, int size, int spam){ struct rule *p; struct node *q; diff --git a/src/rules.h b/src/rules.h index 481f857d..e965736e 100644 --- a/src/rules.h +++ b/src/rules.h @@ -10,7 +10,7 @@ void load_rules(struct session_data *sdata, struct node *xhash[], char *table); int append_rule(struct node *xhash[], struct rule_cond *rule_cond); struct rule *create_rule_item(struct rule_cond *rule_cond); -char *check_againt_ruleset(struct node *xhash[], struct parser_state *state, int size, int spam); +char *check_against_ruleset(struct node *xhash[], struct parser_state *state, int size, int spam); time_t query_retain_period(struct data *data, struct parser_state *state, int size, int spam, struct config *cfg); int get_folder_id_by_rule(struct data *data, struct parser_state *state, int size, int spam, struct config *cfg); int check_size_rule(int message_size, int size, char *_size); diff --git a/src/test.c b/src/test.c index 8b796806..b3695076 100644 --- a/src/test.c +++ b/src/test.c @@ -162,7 +162,7 @@ int main(int argc, char **argv){ printf("hdr len: %d\n", sdata.hdr_len); - rule = check_againt_ruleset(data.archiving_rules, &state, st.st_size, sdata.spam_message); + rule = check_against_ruleset(data.archiving_rules, &state, st.st_size, sdata.spam_message); printf("body digest: %s\n", sdata.bodydigest);