diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1996-08-22 16:08:03 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1996-08-22 16:08:03 +0000 |
commit | 36159e7494bd14e0e19584cc5593c0bb5e902609 (patch) | |
tree | 628af498815c20c016b1aa666979ca2ccee42c36 | |
parent | 88f09345464ede6b863c5d7b08f8c5c639f8c58f (diff) | |
download | fetchmail-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.c | 23 |
1 files changed, 11 insertions, 12 deletions
@@ -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 |