diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1998-01-23 17:37:47 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1998-01-23 17:37:47 +0000 |
commit | e702bc4457fe27fa096b5484c54d0733c9447126 (patch) | |
tree | 3b820f5850e7b37a739ccc3696efecda48ae2fbe | |
parent | dc978c56e3fbbe9c8e3f8da4eef6c5fd3f8a509c (diff) | |
download | fetchmail-e702bc4457fe27fa096b5484c54d0733c9447126.tar.gz fetchmail-e702bc4457fe27fa096b5484c54d0733c9447126.tar.bz2 fetchmail-e702bc4457fe27fa096b5484c54d0733c9447126.zip |
Correct deletion-counter handling on re-poll.
svn path=/trunk/; revision=1611
-rw-r--r-- | imap.c | 38 |
1 files changed, 17 insertions, 21 deletions
@@ -580,6 +580,22 @@ int imap_getauth(int sock, struct query *ctl, char *greeting) return(PS_SUCCESS); } +static int internal_expunge(int sock) +/* ship an expunge, resetting associated counters */ +{ + int ok; + + if ((ok = gen_transact(sock, "EXPUNGE"))) + return(ok); + + expunged += deletions; + deletions = 0; + +#ifdef IMAP_UID /* not used */ + expunge_uids(ctl); +#endif /* IMAP_UID */ +} + static int imap_getrange(int sock, struct query *ctl, const char *folder, @@ -599,11 +615,7 @@ static int imap_getrange(int sock, */ ok = 0; if (deletions && ctl->expunge > 1) - ok = gen_transact(sock, "EXPUNGE"); -#ifdef IMAP_UID /* not used */ - if (!ok) - expunge_uids(ctl); -#endif /* IMAP_UID */ + internal_expunge(sock); count = -1; if (ok || gen_transact(sock, "NOOP")) { @@ -806,22 +818,6 @@ static int imap_trail(int sock, struct query *ctl, int number) return(PS_SUCCESS); } -static int internal_expunge(int sock) -/* ship an expunge, resetting associated counters */ -{ - int ok; - - if ((ok = gen_transact(sock, "EXPUNGE"))) - return(ok); - - expunged = deletions; - deletions = 0; - -#ifdef IMAP_UID /* not used */ - expunge_uids(ctl); -#endif /* IMAP_UID */ -} - static int imap_delete(int sock, struct query *ctl, int number) /* set delete flag for given message */ { |