From 6d1abe35b139565af4fda8a67e2e9566329057db Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 27 Dec 1996 14:16:02 +0000 Subject: Have IMAP set seen flag if keep is on. svn path=/trunk/; revision=699 --- driver.c | 2 +- imap.c | 8 ++++++-- pop2.c | 2 +- pop3.c | 2 +- 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; -- cgit v1.2.3