diff options
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | driver.c | 16 |
2 files changed, 7 insertions, 14 deletions
@@ -8,8 +8,6 @@ Other TO-DO items: * Get with Craig Metz to write a draft RFC on RFC1938 support in IMAP. -* Message length check code (#define MSGLEN) works for IMAP, but not for POP. - How can this be? Release Notes: @@ -19,8 +17,9 @@ fetchmail-4.2.6 () * Improved bug-tracking header, now also emitted when using an MDA. * Cope with Post Office/NT's brain-dead habit of prepending bogus LIST items with a -1 length. +* Return of the size consistency check; this time it works for POP3 too. -There are 284 people on the fetchmail-friends list. +There are 283 people on the fetchmail-friends list. fetchmail-4.2.5 (Mon Sep 22 23:38:46 EDT 1997) * Greg Stark's patch for better autoconfiguration on mixed libc5/libc6 systems. @@ -83,9 +83,7 @@ static int tagnum; static char *shroud; /* string to shroud in debug output, if non-NULL */ static int mytimeout; /* value of nonreponse timeout */ -#ifdef MSGLEN static int msglen; /* actual message length */ -#endif /* MSGLEN */ static void set_timeout(int timeleft) /* reset the nonresponse-timeout */ @@ -524,9 +522,8 @@ int num; /* index of message */ headers = received_for = NULL; from_offs = ctt_offs = env_offs = -1; oldlen = 0; -#ifdef MSGLEN msglen = 0; -#endif /* MSGLEN */ + for (remaining = len; remaining > 0 || protocol->delimited; remaining -= linelen) { char *line; @@ -538,9 +535,7 @@ int num; /* index of message */ if ((n = SockRead(sock, buf, sizeof(buf)-1)) == -1) return(PS_SOCKET); linelen += n; -#ifdef MSGLEN msglen += n; -#endif /* MSGLEN */ /* lines may not be properly CRLF terminated; fix this for qmail */ if (ctl->forcecr) @@ -1217,9 +1212,6 @@ flag forward; /* TRUE to forward */ } } len -= linelen; -#ifdef MSGLEN - msglen += linelen; -#endif /* MSGLEN */ /* check for end of message */ if (protocol->delimited && *buf == '.') @@ -1227,6 +1219,10 @@ flag forward; /* TRUE to forward */ break; else if (buf[1] == '\n' && buf[2] == '\0') break; + else + msglen--; /* subtract the size of the dot escape */ + + msglen += linelen; /* ship out the text line */ if (forward) @@ -1738,11 +1734,9 @@ const struct method *proto; /* protocol method table */ } } -#ifdef MSGLEN /* check to see if the numbers matched? */ if (msgsizes && msglen != msgsizes[num-1]) error(0, 0, "size of message %d (%d) was not what was expected (%d)", num, msglen, msgsizes[num-1]); -#endif /* MSGLEN */ /* end-of-message processing starts here */ if (outlevel == O_VERBOSE) |