pop3 import can remove messages from server

This commit is contained in:
SJ 2014-04-17 15:39:40 +02:00
parent 1efe9ffc02
commit db26a463d0

View File

@ -197,6 +197,12 @@ int process_pop3_emails(int sd, struct session_data *sdata, struct __data *data,
if(dryrun == 0) rc = import_message(filename, sdata, data, cfg); if(dryrun == 0) rc = import_message(filename, sdata, data, cfg);
else rc = OK; else rc = OK;
if(dryrun == 0 && rc == OK && data->import->remove_after_import == 1){
snprintf(buf, sizeof(buf)-1, "DELE %d\r\n", i);
n = write1(sd, buf, strlen(buf), use_ssl, data->ssl);
n = recvtimeoutssl(sd, buf, sizeof(buf), 10, use_ssl, data->ssl);
}
if(i % 100 == 0){ if(i % 100 == 0){
time(&(data->import->updated)); time(&(data->import->updated));
update_import_job_stat(sdata, data); update_import_job_stat(sdata, data);