aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1996-08-22 16:08:03 +0000
committerEric S. Raymond <esr@thyrsus.com>1996-08-22 16:08:03 +0000
commit36159e7494bd14e0e19584cc5593c0bb5e902609 (patch)
tree628af498815c20c016b1aa666979ca2ccee42c36
parent88f09345464ede6b863c5d7b08f8c5c639f8c58f (diff)
downloadfetchmail-36159e7494bd14e0e19584cc5593c0bb5e902609.tar.gz
fetchmail-36159e7494bd14e0e19584cc5593c0bb5e902609.tar.bz2
fetchmail-36159e7494bd14e0e19584cc5593c0bb5e902609.zip
Change the LAST logic slightly, preparatory to using UIDL.
svn path=/trunk/; revision=55
-rw-r--r--pop3.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/pop3.c b/pop3.c
index 5571d6d9..adb865cf 100644
--- a/pop3.c
+++ b/pop3.c
@@ -121,15 +121,16 @@ struct hostrec *queryctl;
goto cleanUp;
}
- /* Ask for number of last message retrieved */
- if (queryctl->fetchall)
- first = 1;
- else {
+ /*
+ * Ask for number of last message retrieved.
+ * Newer, RFC-1760-conformant POP servers may not have the LAST command.
+ * Therefore we don't croak if we get a nonzero return.
+ */
+ first = 1;
+ if (!queryctl->fetchall) {
ok = POP3_sendLAST(&first, socket);
- if (ok != 0)
- goto cleanUp;
-
- first++;
+ if (ok == 0)
+ first++;
}
/* show them how many messages we'll be downloading */
@@ -138,14 +139,12 @@ struct hostrec *queryctl;
fprintf(stderr,"%d messages in folder, %d new messages.\n",
count, count - first + 1);
else
- fprintf(stderr,"%d new messages in folder.\n", count);
+ fprintf(stderr,"%d %smessages in folder.\n", count, ok ? "" : "new ");
else
;
if (count > 0) {
- for (number = (queryctl->flush || queryctl->fetchall)? 1 : first;
- number <= count;
- number++) {
+ for (number = queryctl->flush ? 1 : first; number <= count; number++) {
/* open the mail pipe if we're using an MDA */
if (queryctl->output == TO_MDA