From 61285c7f2db6ad78adb7a66a271dbbfd60aca6fe Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 25 May 1998 18:36:52 +0000 Subject: Kok Seng's package to prevent UID lossage. svn path=/trunk/; revision=1826 --- NEWS | 1 + fetchmail.c | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 7a0c34f4..dad4f19f 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ fetchmail-4.4.8 (): * Removed fetchall side-effect kluge, now that we knowe how to make TOP work with qpopper 2.3+. +* Patch by Kok Seng to prevent loss of UID info when a query fails. * Several fixes for command-line processing from Gunther Leber: - in fetchmail.c * set tmpbuf to NULL after freeing the buffer (so this will hopefully diff --git a/fetchmail.c b/fetchmail.c index 5e3e28ac..e7c7e3b3 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -3,7 +3,6 @@ * * For license terms, see the file COPYING in this directory. */ - #include "config.h" #include @@ -511,13 +510,25 @@ int main (int argc, char **argv) querystatus = query_host(ctl); - if (querystatus == PS_SUCCESS) { + if (querystatus == PS_SUCCESS) + { successes++; #ifdef POP3_ENABLE if (!check_only) - update_str_lists(ctl); + update_str_lists(ctl); + + /* Save UID list to prevent re-fetch in case fetchmail + recover from crash */ + if (!check_only) + { + write_saved_lists(querylist, run.idfile); + syslog(LOG_INFO,"Saved UID List"); + } #endif /* POP3_ENABLE */ } + else + syslog(LOG_INFO,"Query status=%d", querystatus); + #if defined(linux) && !INET6 if (ctl->server.monitor) { -- cgit v1.2.3