diff options
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | driver.c | 9 | ||||
-rw-r--r-- | fetchmail.h | 1 | ||||
-rw-r--r-- | imap.c | 10 | ||||
-rw-r--r-- | pop2.c | 1 | ||||
-rw-r--r-- | pop3.c | 1 |
6 files changed, 10 insertions, 15 deletions
@@ -18,6 +18,9 @@ bugs -- * Ensure that default server parameters get properly zeroed out after each poll or skip statement in .fetchmailrc. +* Arrange an EXPUNGE after each delete when using IMAP, so deletions get done + OK even if there's a socket error before termination. + There are 188 people on the fetchmail-friends list. ------------------------------------------------------------------------------ @@ -1204,15 +1204,6 @@ const struct method *proto; /* protocol method table */ break; } - /* remove all messages flagged for deletion */ - if (protocol->expunge_cmd && deletions > 0) - { - ok = gen_transact(sockfp, protocol->expunge_cmd); - if (ok != 0) - goto cleanUp; - vtalarm(ctl->server.timeout); - } - ok = gen_transact(sockfp, protocol->exit_cmd); if (ok == 0) ok = PS_SUCCESS; diff --git a/fetchmail.h b/fetchmail.h index a329c19f..d969945c 100644 --- a/fetchmail.h +++ b/fetchmail.h @@ -128,7 +128,6 @@ struct method int (*fetch)(); /* fetch a given message */ int (*trail)(); /* eat trailer of a message */ int (*delete)(); /* delete method */ - char *expunge_cmd; /* expunge command */ char *exit_cmd; /* exit command */ }; @@ -202,12 +202,17 @@ static int imap_trail(FILE *sockfp, struct query *ctl, int number) static int imap_delete(FILE *sockfp, struct query *ctl, int number) /* set delete flag for given message */ { + int ok; + /* use SILENT if possible as a minor throughput optimization */ - return(gen_transact(sockfp, + if ((ok = gen_transact(sockfp, imap4 ? "STORE %d +FLAGS.SILENT (\\Deleted)" : "STORE %d +FLAGS (\\Deleted)", - number)); + number))) + return(ok); + + return(gen_transact(sockfp, "EXPUNGE")); } const static struct method imap = @@ -224,7 +229,6 @@ const static struct method imap = imap_fetch, /* request given message */ imap_trail, /* eat message trailer */ imap_delete, /* set IMAP delete flag */ - "EXPUNGE", /* the IMAP expunge command */ "LOGOUT", /* the IMAP exit command */ }; @@ -128,7 +128,6 @@ const static struct method pop2 = pop2_fetch, /* request given message */ pop2_trail, /* eat message trailer */ NULL, /* no POP2 delete method */ - NULL, /* no POP2 expunge command */ "QUIT", /* the POP2 exit command */ }; @@ -280,7 +280,6 @@ const static struct method pop3 = pop3_fetch, /* request given message */ NULL, /* no message trailer */ pop3_delete, /* how to delete a message */ - NULL, /* no POP3 expunge command */ "QUIT", /* the POP3 exit command */ }; |