diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2002-12-26 22:06:03 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2002-12-26 22:06:03 +0000 |
commit | 366eb7b3a91d53282f0b1007913a55be236a322e (patch) | |
tree | eaf93bd4f0af17a32223f3a85ed027e365544acc /pop3.c | |
parent | df9d522301cbc3e73e9816485f7deb744ae6f373 (diff) | |
download | fetchmail-366eb7b3a91d53282f0b1007913a55be236a322e.tar.gz fetchmail-366eb7b3a91d53282f0b1007913a55be236a322e.tar.bz2 fetchmail-366eb7b3a91d53282f0b1007913a55be236a322e.zip |
Routine updates, including the latest Shetye patch.
svn path=/trunk/; revision=3778
Diffstat (limited to 'pop3.c')
-rw-r--r-- | pop3.c | 32 |
1 files changed, 31 insertions, 1 deletions
@@ -792,11 +792,40 @@ static int pop3_fetch(int sock, struct query *ctl, int number, int *lenp) return(PS_SUCCESS); } +static void mark_uid_seen(struct query *ctl, int number) +/* Tell the UID code we've seen this. */ +{ + if (ctl->newsaved) + { + struct idlist *sdp; + + for (sdp = ctl->newsaved; sdp; sdp = sdp->next) + if (sdp->val.status.num == number) + { + sdp->val.status.mark = UID_SEEN; + save_str(&ctl->oldsaved, sdp->id,UID_SEEN); + } + } +} + static int pop3_delete(int sock, struct query *ctl, int number) /* delete a given message */ { + int ok; + mark_uid_seen(ctl, number); /* actually, mark for deletion -- doesn't happen until QUIT time */ - return(gen_transact(sock, "DELE %d", number)); + ok = gen_transact(sock, "DELE %d", number); + if (ok != PS_SUCCESS) + return(ok); + delete_str(&ctl->newsaved, number); + return(PS_SUCCESS); +} + +static int pop3_mark_seen(int sock, struct query *ctl, int number) +/* mark a given message as seen */ +{ + mark_uid_seen(ctl, number); + return(PS_SUCCESS); } static int pop3_logout(int sock, struct query *ctl) @@ -856,6 +885,7 @@ const static struct method pop3 = NULL, /* no way to fetch body alone */ NULL, /* no message trailer */ pop3_delete, /* how to delete a message */ + pop3_mark_seen, /* how to mark a message as seen */ pop3_logout, /* log out, we're done */ FALSE, /* no, we can't re-poll */ }; |