mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-24 18:50:12 +01:00
src: syslog if problematic message is moved
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
36b1e03939
commit
1c27ead3af
@ -170,6 +170,7 @@ int process_email(char *filename, struct session_data *sdata, struct data *data,
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
status = S_STATUS_ERROR;
|
status = S_STATUS_ERROR;
|
||||||
|
|
||||||
// move the file from piler/tmp/[0-xxx] dir to piler/error directory
|
// move the file from piler/tmp/[0-xxx] dir to piler/error directory
|
||||||
p = strchr(filename, '/');
|
p = strchr(filename, '/');
|
||||||
if(p)
|
if(p)
|
||||||
@ -178,7 +179,10 @@ int process_email(char *filename, struct session_data *sdata, struct data *data,
|
|||||||
p = filename;
|
p = filename;
|
||||||
|
|
||||||
snprintf(tmpbuf, sizeof(tmpbuf)-1, "%s/%s", ERROR_DIR, p);
|
snprintf(tmpbuf, sizeof(tmpbuf)-1, "%s/%s", ERROR_DIR, p);
|
||||||
rename(filename, tmpbuf);
|
if(rename(filename, tmpbuf) == 0)
|
||||||
|
syslog(LOG_PRIORITY, "%s: moved to %s", filename, tmpbuf);
|
||||||
|
else
|
||||||
|
syslog(LOG_PRIORITY, "%s: failed to moved to %s", filename, tmpbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(rc != ERR) unlink(filename);
|
if(rc != ERR) unlink(filename);
|
||||||
|
Loading…
Reference in New Issue
Block a user