mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 19:00:12 +01:00
Fixed data.import issue
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
4c4e1b52b3
commit
dd17184430
@ -73,7 +73,7 @@ int import_message(struct session_data *sdata, struct data *data, struct config
|
|||||||
state = parse_message(sdata, 1, data, cfg);
|
state = parse_message(sdata, 1, data, cfg);
|
||||||
post_parse(sdata, &state, 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(rule){
|
||||||
if(data->quiet == 0) printf("discarding %s by archiving policy: %s\n", data->import->filename, rule);
|
if(data->quiet == 0) printf("discarding %s by archiving policy: %s\n", data->import->filename, rule);
|
||||||
|
@ -19,7 +19,7 @@ int open_database(struct session_data *sdata, struct config *cfg){
|
|||||||
mysql_options(&(sdata->mysql), MYSQL_OPT_RECONNECT, (const char*)&rc);
|
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){
|
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;
|
return ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,6 +131,7 @@ int process_email(char *filename, struct session_data *sdata, struct data *data,
|
|||||||
snprintf(sdata->filename, SMALLBUFSIZE-1, "%s", filename);
|
snprintf(sdata->filename, SMALLBUFSIZE-1, "%s", filename);
|
||||||
|
|
||||||
parser_state = parse_message(sdata, 1, data, cfg);
|
parser_state = parse_message(sdata, 1, data, cfg);
|
||||||
|
|
||||||
post_parse(sdata, &parser_state, cfg);
|
post_parse(sdata, &parser_state, cfg);
|
||||||
|
|
||||||
if(cfg->syslog_recipients == 1){
|
if(cfg->syslog_recipients == 1){
|
||||||
@ -144,8 +145,7 @@ int process_email(char *filename, struct session_data *sdata, struct data *data,
|
|||||||
} while(rcpt);
|
} while(rcpt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
arule = check_against_ruleset(data->archiving_rules, &parser_state, sdata->tot_len, sdata->spam_message);
|
||||||
arule = check_againt_ruleset(data->archiving_rules, &parser_state, sdata->tot_len, sdata->spam_message);
|
|
||||||
|
|
||||||
if(arule){
|
if(arule){
|
||||||
syslog(LOG_PRIORITY, "%s: discarding: archiving policy: *%s*", filename, 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.retention_rules);
|
||||||
initrules(data.folder_rules);
|
initrules(data.folder_rules);
|
||||||
data.dedup = MAP_FAILED;
|
data.dedup = MAP_FAILED;
|
||||||
|
data.import = NULL;
|
||||||
|
|
||||||
initialise_configuration();
|
initialise_configuration();
|
||||||
|
|
||||||
|
@ -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 rule *p;
|
||||||
struct node *q;
|
struct node *q;
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
void load_rules(struct session_data *sdata, struct node *xhash[], char *table);
|
void load_rules(struct session_data *sdata, struct node *xhash[], char *table);
|
||||||
int append_rule(struct node *xhash[], struct rule_cond *rule_cond);
|
int append_rule(struct node *xhash[], struct rule_cond *rule_cond);
|
||||||
struct rule *create_rule_item(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);
|
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 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);
|
int check_size_rule(int message_size, int size, char *_size);
|
||||||
|
@ -162,7 +162,7 @@ int main(int argc, char **argv){
|
|||||||
|
|
||||||
printf("hdr len: %d\n", sdata.hdr_len);
|
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);
|
printf("body digest: %s\n", sdata.bodydigest);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user