aboutsummaryrefslogtreecommitdiffstats
path: root/pop3.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-06-13 04:26:32 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-06-13 04:26:32 +0000
commit06429f4fdbc612f8baeb6a93461a4f0b345dd806 (patch)
tree9fbbdd157f372c062ac31d23fe27b00ddf21d7b3 /pop3.c
parent34b907faffe844c6d4da36df22fea23d5b729fe0 (diff)
downloadfetchmail-06429f4fdbc612f8baeb6a93461a4f0b345dd806.tar.gz
fetchmail-06429f4fdbc612f8baeb6a93461a4f0b345dd806.tar.bz2
fetchmail-06429f4fdbc612f8baeb6a93461a4f0b345dd806.zip
Handle slavishly RFC1725-conformant servers.
svn path=/trunk/; revision=1092
Diffstat (limited to 'pop3.c')
-rw-r--r--pop3.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/pop3.c b/pop3.c
index 600d9917..76b66846 100644
--- a/pop3.c
+++ b/pop3.c
@@ -244,9 +244,23 @@ static int pop3_fetch(int sock, struct query *ctl, int number, int *lenp)
gen_send(sock, "RETR %d", number);
if ((ok = pop3_ok(sock, buf)) != 0)
return(ok);
- /* look for "nnn octets" -- there may or may not be preceding cruft */
+
+ /*
+ * Look for "nnn octets" -- there may or may not be preceding cruft.
+ *
+ * Note, it is not guaranteed this will be set; the never-to-be-
+ * sufficiently-damned RFC1725 doesn't require it. At least one
+ * actual POP3 daemon (MercuryP/NLM v1.31) actually fails to issue
+ * a length.
+ *
+ * To kluge around this, wedge a huge value into the message
+ * length if we don't get one back. The only bad effect this will
+ * have is to make the progress messages look funny. We'll
+ * document this as a bug instead of forcing every poll to do a
+ * LIST for sizes.
+ */
if ((cp = strstr(buf, " octets")) == (char *)NULL)
- *lenp = 0;
+ *lenp = 0xffffffff;
else
{
while (--cp >= buf && isdigit(*cp))