From 876f21bec0ddf6e93b8c3fe63c011eea6f176f3e Mon Sep 17 00:00:00 2001 From: SJ Date: Thu, 3 Sep 2015 14:42:49 +0200 Subject: [PATCH] fix a dry run and remove issue for imap imports --- src/imap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);