aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--fetchmail.c5
-rw-r--r--fetchmail.h2
-rw-r--r--uid.c2
4 files changed, 7 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index c812dbb1..12c6d4ac 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@
* Fixed Debian bug #63667, fetchmailconf: doesn't write .fetchmailrc properly.
* RFC2177 IDLE should now be done even when there are no messages.
* Joerg Plate's SSL typo fix.
+* Try to limit the damage bad UIDL handling can do by refusing to mess with
+ the UIDL state if there has been an error.
fetchmail-5.4.2 (Wed Jun 28 07:21:04 EDT 2000), 19069 lines:
diff --git a/fetchmail.c b/fetchmail.c
index f2f3cff6..b1cf9cb8 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -648,8 +648,9 @@ int main(int argc, char **argv)
querystatus = query_host(ctl);
#ifdef POP3_ENABLE
- if (!check_only)
- uid_end_query(ctl);
+ /* leave the UIDL state alone if there have been any errors */
+ if (!check_only && !querystatus)
+ uid_swap_lists(ctl);
#endif /* POP3_ENABLE */
if (querystatus == PS_SUCCESS)
diff --git a/fetchmail.h b/fetchmail.h
index 1603f4e6..980bd47b 100644
--- a/fetchmail.h
+++ b/fetchmail.h
@@ -453,7 +453,7 @@ char *str_find(struct idlist **, int);
char *idpair_find(struct idlist **, const char *);
void append_str_list(struct idlist **, struct idlist **);
void expunge_uids(struct query *);
-void uid_end_query(struct query *);
+void uid_swap_lists(struct query *);
void write_saved_lists(struct query *, const char *);
/* rcfile_y.y */
diff --git a/uid.c b/uid.c
index cf8a008b..12405519 100644
--- a/uid.c
+++ b/uid.c
@@ -424,7 +424,7 @@ void expunge_uids(struct query *ctl)
idl->val.status.mark = UID_EXPUNGED;
}
-void uid_end_query(struct query *ctl)
+void uid_swap_lists(struct query *ctl)
/* finish a query */
{
/* debugging code */