mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 19:20:12 +01:00
piler daemon forgot to remove the stripped attachments if the message was discarded by an archiving rule. Fixed
This commit is contained in:
parent
fee08e9de8
commit
e371f5ebfa
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
#define VERSION "0.1.23-master-branch"
|
#define VERSION "0.1.23-master-branch"
|
||||||
|
|
||||||
#define BUILD 742
|
#define BUILD 743
|
||||||
|
|
||||||
#define HOSTID "mailarchiver"
|
#define HOSTID "mailarchiver"
|
||||||
|
|
||||||
|
@ -423,6 +423,13 @@ CLOSE:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void remove_stripped_attachments(struct _state *state){
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for(i=1; i<=state->n_attachments; i++) unlink(state->attachments[i].internalname);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int process_message(struct session_data *sdata, struct _state *state, struct __data *data, struct __config *cfg){
|
int process_message(struct session_data *sdata, struct _state *state, struct __data *data, struct __config *cfg){
|
||||||
int i, rc;
|
int i, rc;
|
||||||
uint64 id=0;
|
uint64 id=0;
|
||||||
@ -430,7 +437,7 @@ int process_message(struct session_data *sdata, struct _state *state, struct __d
|
|||||||
/* discard if existing message_id */
|
/* discard if existing message_id */
|
||||||
|
|
||||||
if(is_existing_message_id(sdata, state, data, cfg) == 1){
|
if(is_existing_message_id(sdata, state, data, cfg) == 1){
|
||||||
for(i=1; i<=state->n_attachments; i++) unlink(state->attachments[i].internalname);
|
remove_stripped_attachments(state);
|
||||||
|
|
||||||
if(strlen(state->b_journal_to) > 0){
|
if(strlen(state->b_journal_to) > 0){
|
||||||
id = get_metaid_by_messageid(sdata, state->message_id, cfg);
|
id = get_metaid_by_messageid(sdata, state->message_id, cfg);
|
||||||
|
@ -35,6 +35,7 @@ void digest_string(char *s, char *digest);
|
|||||||
|
|
||||||
int handle_smtp_session(int new_sd, struct __data *data, struct __config *cfg);
|
int handle_smtp_session(int new_sd, struct __data *data, struct __config *cfg);
|
||||||
|
|
||||||
|
void remove_stripped_attachments(struct _state *state);
|
||||||
int process_message(struct session_data *sdata, struct _state *state, struct __data *data, struct __config *cfg);
|
int process_message(struct session_data *sdata, struct _state *state, struct __data *data, struct __config *cfg);
|
||||||
int store_file(struct session_data *sdata, char *filename, int startpos, int len, struct __config *cfg);
|
int store_file(struct session_data *sdata, char *filename, int startpos, int len, struct __config *cfg);
|
||||||
int remove_stored_message_files(struct session_data *sdata, struct _state *state, struct __config *cfg);
|
int remove_stored_message_files(struct session_data *sdata, struct _state *state, struct __config *cfg);
|
||||||
|
@ -217,6 +217,8 @@ int handle_smtp_session(int new_sd, struct __data *data, struct __config *cfg){
|
|||||||
syslog(LOG_PRIORITY, "%s: discarding message by archiving policy: *%s*", sdata.ttmpfile, arule);
|
syslog(LOG_PRIORITY, "%s: discarding message by archiving policy: *%s*", sdata.ttmpfile, arule);
|
||||||
inj = OK;
|
inj = OK;
|
||||||
counters.c_ignore++;
|
counters.c_ignore++;
|
||||||
|
|
||||||
|
remove_stripped_attachments(&sstate);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
inj = process_message(&sdata, &sstate, data, cfg);
|
inj = process_message(&sdata, &sstate, data, cfg);
|
||||||
|
Loading…
Reference in New Issue
Block a user