mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 20:20:12 +01:00
improved logging of retention days
This commit is contained in:
parent
7ea15b5b05
commit
d1cae282dc
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#define VERSION "0.1.24-master-branch"
|
#define VERSION "0.1.24-master-branch"
|
||||||
|
|
||||||
#define BUILD 827
|
#define BUILD 828
|
||||||
|
|
||||||
#define HOSTID "mailarchiver"
|
#define HOSTID "mailarchiver"
|
||||||
|
|
||||||
|
@ -172,6 +172,8 @@ struct _state {
|
|||||||
int bodylen;
|
int bodylen;
|
||||||
int tolen;
|
int tolen;
|
||||||
int journaltolen;
|
int journaltolen;
|
||||||
|
|
||||||
|
int retention;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -97,6 +97,8 @@ void init_state(struct _state *state){
|
|||||||
state->tolen = 0;
|
state->tolen = 0;
|
||||||
state->bodylen = 0;
|
state->bodylen = 0;
|
||||||
state->journaltolen = 0;
|
state->journaltolen = 0;
|
||||||
|
|
||||||
|
state->retention = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ unsigned long query_retain_period(struct __data *data, struct _state *state, int
|
|||||||
|
|
||||||
if(p->domainlen > 2){
|
if(p->domainlen > 2){
|
||||||
if(strcasestr(state->b_to_domain, p->domain) || strcasestr(state->b_from_domain, p->domain)){
|
if(strcasestr(state->b_to_domain, p->domain) || strcasestr(state->b_from_domain, p->domain)){
|
||||||
if(cfg->verbosity >= _LOG_INFO) syslog(LOG_INFO, "from domain: '%s', to domain: '%s', retention days: %d", state->b_from_domain, state->b_to_domain, p->days);
|
state->retention = p->days;
|
||||||
return p->days * 86400;
|
return p->days * 86400;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -213,13 +213,15 @@ unsigned long query_retain_period(struct __data *data, struct _state *state, int
|
|||||||
check_attachment_rule(state, p) == 1 &&
|
check_attachment_rule(state, p) == 1 &&
|
||||||
check_spam_rule(spam, p->spam) == 1
|
check_spam_rule(spam, p->spam) == 1
|
||||||
){
|
){
|
||||||
if(cfg->verbosity >= _LOG_INFO) syslog(LOG_INFO, "from domain: '%s', to domain: '%s', retention days: %d", state->b_from_domain, state->b_to_domain, p->days);
|
state->retention = p->days;
|
||||||
return p->days * 86400;
|
return p->days * 86400;
|
||||||
}
|
}
|
||||||
|
|
||||||
p = p->r;
|
p = p->r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
state->retention = cfg->default_retention_days;
|
||||||
|
|
||||||
return cfg->default_retention_days * 86400;
|
return cfg->default_retention_days * 86400;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,7 +262,7 @@ int handle_smtp_session(int new_sd, struct __data *data, struct __config *cfg){
|
|||||||
(sdata.__acquire+sdata.__parsed+sdata.__av+sdata.__compress+sdata.__encrypt+sdata.__store)/1000000.0,
|
(sdata.__acquire+sdata.__parsed+sdata.__av+sdata.__compress+sdata.__encrypt+sdata.__store)/1000000.0,
|
||||||
sdata.__acquire/1000000.0, sdata.__parsed/1000000.0, sdata.__av/1000000.0, sdata.__compress/1000000.0, sdata.__encrypt/1000000.0, sdata.__store/1000000.0);
|
sdata.__acquire/1000000.0, sdata.__parsed/1000000.0, sdata.__av/1000000.0, sdata.__compress/1000000.0, sdata.__encrypt/1000000.0, sdata.__store/1000000.0);
|
||||||
|
|
||||||
syslog(LOG_PRIORITY, "%s: from=%s, size=%d, reference=%s, message-id=%s, %s", sdata.ttmpfile, sdata.fromemail, sdata.tot_len, sstate.reference, sstate.message_id, delay);
|
syslog(LOG_PRIORITY, "%s: from=%s, size=%d, reference=%s, message-id=%s, retention=%d, %s", sdata.ttmpfile, sdata.fromemail, sdata.tot_len, sstate.reference, sstate.message_id, sstate.retention, delay);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user