aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1996-12-27 14:16:02 +0000
committerEric S. Raymond <esr@thyrsus.com>1996-12-27 14:16:02 +0000
commit6d1abe35b139565af4fda8a67e2e9566329057db (patch)
treee9e2f9c0d8825201f6c50c6b1dc12715d4783be1
parent1317f454a87c5e6421e227a5d8918ddbb943bf5d (diff)
downloadfetchmail-6d1abe35b139565af4fda8a67e2e9566329057db.tar.gz
fetchmail-6d1abe35b139565af4fda8a67e2e9566329057db.tar.bz2
fetchmail-6d1abe35b139565af4fda8a67e2e9566329057db.zip
Have IMAP set seen flag if keep is on.
svn path=/trunk/; revision=699
-rw-r--r--driver.c2
-rw-r--r--imap.c8
-rw-r--r--pop2.c2
-rw-r--r--pop3.c2
4 files changed, 9 insertions, 5 deletions
diff --git a/driver.c b/driver.c
index 49d97c98..459bfd81 100644
--- a/driver.c
+++ b/driver.c
@@ -1021,7 +1021,7 @@ const struct method *proto; /* protocol method table */
else
{
/* request a message */
- ok = (protocol->fetch)(sockfp, num, &len);
+ ok = (protocol->fetch)(sockfp, ctl, num, &len);
if (ok != 0)
goto cleanUp;
vtalarm(ctl->timeout);
diff --git a/imap.c b/imap.c
index f9fdbbaa..e65807ec 100644
--- a/imap.c
+++ b/imap.c
@@ -154,7 +154,7 @@ static int imap_is_old(FILE *sockfp, struct query *ctl, int num)
return(seen);
}
-static int imap_fetch(FILE *sockfp, int number, int *lenp)
+static int imap_fetch(FILE *sockfp, struct query *ctl, int number, int *lenp)
/* request nth message */
{
char buf [POPBUFSIZE+1];
@@ -165,8 +165,12 @@ static int imap_fetch(FILE *sockfp, int number, int *lenp)
* seen flag. This is good! It means that if the protocol exchange
* craps out during the message, it will still be marked `unseen' on
* the server.
+ *
+ * However...*don't* do this if we're using keep to suppress deletion!
+ * In that case, marking the seen flag is the only way to prevent the
+ * message from being re-fetched on subsequent runs.
*/
- if (imap4)
+ if (imap4 && !ctl->keep)
gen_send(sockfp, "FETCH %d RFC822.PEEK", number);
else
gen_send(sockfp, "FETCH %d RFC822", number);
diff --git a/pop2.c b/pop2.c
index 955e634e..667732e8 100644
--- a/pop2.c
+++ b/pop2.c
@@ -92,7 +92,7 @@ static int pop2_getrange(FILE *sockfp, struct query *ctl, int*countp, int*newp)
return(0);
}
-static int pop2_fetch(FILE *sockfp, int number, int *lenp)
+static int pop2_fetch(FILE *sockfp, struct query *ctl, int number, int *lenp)
/* request nth message */
{
int ok;
diff --git a/pop3.c b/pop3.c
index 0238fc35..3f2dae3c 100644
--- a/pop3.c
+++ b/pop3.c
@@ -239,7 +239,7 @@ static int pop3_is_old(FILE *sockfp, struct query *ctl, int num)
str_find (&ctl->newsaved, num)));
}
-static int pop3_fetch(FILE *sockfp, int number, int *lenp)
+static int pop3_fetch(FILE *sockfp, struct query *ctl, int number, int *lenp)
/* request nth message */
{
int ok;