aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-01-14 17:21:05 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-01-14 17:21:05 +0000
commitdf46e177477e50b30d7425c8b7c05c0e54a9113e (patch)
tree0414c2538f7dbc322f76369a0798f8f5be3180a4
parent6f98e2a0e0f7cbc4591537e6f0f85ea385cf1451 (diff)
downloadfetchmail-df46e177477e50b30d7425c8b7c05c0e54a9113e.tar.gz
fetchmail-df46e177477e50b30d7425c8b7c05c0e54a9113e.tar.bz2
fetchmail-df46e177477e50b30d7425c8b7c05c0e54a9113e.zip
Expunge fix.
svn path=/trunk/; revision=759
-rw-r--r--NEWS3
-rw-r--r--driver.c9
-rw-r--r--fetchmail.h1
-rw-r--r--imap.c10
-rw-r--r--pop2.c1
-rw-r--r--pop3.c1
6 files changed, 10 insertions, 15 deletions
diff --git a/NEWS b/NEWS
index cd9c5606..b2ea6cf2 100644
--- a/NEWS
+++ b/NEWS
@@ -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.
------------------------------------------------------------------------------
diff --git a/driver.c b/driver.c
index 68347610..531b6f73 100644
--- a/driver.c
+++ b/driver.c
@@ -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 */
};
diff --git a/imap.c b/imap.c
index 404f75c0..3a760cac 100644
--- a/imap.c
+++ b/imap.c
@@ -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 */
};
diff --git a/pop2.c b/pop2.c
index b606a291..fcf907f0 100644
--- a/pop2.c
+++ b/pop2.c
@@ -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 */
};
diff --git a/pop3.c b/pop3.c
index b095f4cc..9a37a328 100644
--- a/pop3.c
+++ b/pop3.c
@@ -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 */
};