mirror of
https://bitbucket.org/jsuto/piler.git
synced 2025-06-13 12:47:03 +02:00
src: move problematic messages to error directory
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
@ -11,13 +11,14 @@
|
||||
|
||||
#define VERSION "1.3.2"
|
||||
|
||||
#define BUILD 982
|
||||
#define BUILD 983
|
||||
|
||||
#define HOSTID "mailarchiver"
|
||||
|
||||
#define CONFIG_FILE CONFDIR "/piler/piler.conf"
|
||||
#define WORK_DIR DATADIR "/piler/tmp"
|
||||
#define QUEUE_DIR DATADIR "/piler/store"
|
||||
#define ERROR_DIR DATADIR "/piler/error"
|
||||
|
||||
#define CLAMD_SOCKET "/tmp/clamd"
|
||||
|
||||
|
10
src/piler.c
10
src/piler.c
@ -93,6 +93,7 @@ int process_email(char *filename, struct session_data *sdata, struct data *data,
|
||||
char *status=S_STATUS_UNDEF;
|
||||
char *arule;
|
||||
char *rcpt;
|
||||
char *p;
|
||||
struct timezone tz;
|
||||
struct timeval tv1, tv2;
|
||||
struct parser_state parser_state;
|
||||
@ -169,6 +170,15 @@ int process_email(char *filename, struct session_data *sdata, struct data *data,
|
||||
}
|
||||
else {
|
||||
status = S_STATUS_ERROR;
|
||||
// move the file from piler/tmp/[0-xxx] dir to piler/error directory
|
||||
p = strchr(filename, '/');
|
||||
if(p)
|
||||
p++;
|
||||
else
|
||||
p = filename;
|
||||
|
||||
snprintf(tmpbuf, sizeof(tmpbuf)-1, "%s/%s", ERROR_DIR, p);
|
||||
rename(filename, tmpbuf);
|
||||
}
|
||||
|
||||
if(rc != ERR) unlink(filename);
|
||||
|
Reference in New Issue
Block a user