diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1997-09-16 16:22:45 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1997-09-16 16:22:45 +0000 |
commit | 7bec68cc0265f82134280afc7b0a937cf93f3b83 (patch) | |
tree | ed56be9e2e38cc3da129e4a5ba64c05e48cf3b8b | |
parent | 00401d8fb5a1bba90ffd7804db6788ed4833ffdb (diff) | |
download | fetchmail-7bec68cc0265f82134280afc7b0a937cf93f3b83.tar.gz fetchmail-7bec68cc0265f82134280afc7b0a937cf93f3b83.tar.bz2 fetchmail-7bec68cc0265f82134280afc7b0a937cf93f3b83.zip |
Check for MS-Exchangeness.
svn path=/trunk/; revision=1351
-rw-r--r-- | driver.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -84,6 +84,7 @@ static int tagnum; static char *shroud; /* string to shroud in debug output, if non-NULL */ static int mytimeout; /* value of nonreponse timeout */ +static int msglen; /* actual message length */ static void set_timeout(int timeleft) /* reset the nonresponse-timeout */ @@ -528,7 +529,7 @@ int num; /* index of message */ /* read message headers */ headers = received_for = NULL; from_offs = ctt_offs = env_offs = -1; - oldlen = 0; + oldlen = msglen = 0; for (remaining = len; remaining > 0 || protocol->delimited; remaining -= linelen) { char *line; @@ -540,6 +541,7 @@ int num; /* index of message */ if ((n = SockRead(sock, buf, sizeof(buf)-1)) == -1) return(PS_SOCKET); linelen += n; + msglen += n; /* lines may not be properly CRLF terminated; fix this for qmail */ if (ctl->forcecr) @@ -1179,6 +1181,7 @@ flag forward; /* TRUE to forward */ } } len -= linelen; + msglen += linelen; /* check for end of message */ if (protocol->delimited && *buf == '.') @@ -1680,6 +1683,10 @@ const struct method *proto; /* protocol method table */ } } + /* check to see if the numbers matched? */ + if (msglen != len) + error(0, 0, "size of message %d (%d) was not what was expected (%d)", num, msglen, len); + /* end-of-message processing starts here */ if (outlevel == O_VERBOSE) fputc('\n', stderr); |