Fixed data.import issue

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2019-01-13 15:12:14 +00:00
parent 4c4e1b52b3
commit dd17184430
6 changed files with 8 additions and 7 deletions

View File

@ -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);

View File

@ -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;
}

View File

@ -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();

View File

@ -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;

View File

@ -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);

View File

@ -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);