diff --git a/src/imap.c b/src/imap.c index b41dcf8a..bff1795a 100644 --- a/src/imap.c +++ b/src/imap.c @@ -248,7 +248,7 @@ int process_imap_folder(int sd, int *seq, char *folder, struct session_data *sda if(rc == ERR) printf("error importing '%s'\n", filename); else { - if(data->import->remove_after_import == 1){ + if(data->import->remove_after_import == 1 && dryrun == 0){ snprintf(buf, sizeof(buf)-1, "A%d STORE %d +FLAGS.SILENT (\\Deleted)\r\n", *seq, i); n = write1(sd, buf, strlen(buf), use_ssl, data->ssl); read_response(sd, buf, sizeof(buf), seq, data, use_ssl); @@ -260,7 +260,7 @@ int process_imap_folder(int sd, int *seq, char *folder, struct session_data *sda } - if(data->import->remove_after_import == 1){ + if(data->import->remove_after_import == 1 && dryrun == 0){ snprintf(buf, sizeof(buf)-1, "A%d EXPUNGE\r\n", *seq); n = write1(sd, buf, strlen(buf), use_ssl, data->ssl); read_response(sd, buf, sizeof(buf), seq, data, use_ssl);