aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-09-30 22:08:05 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-09-30 22:08:05 +0000
commit0e6a306ee65ea3c0346cd57a40303cddf4d35b5a (patch)
tree5e374627c39c340378d669653e1f8fc9c8d51daf
parente83dc39d6853ec31919ee54223fe1196b8d7de1d (diff)
downloadfetchmail-0e6a306ee65ea3c0346cd57a40303cddf4d35b5a.tar.gz
fetchmail-0e6a306ee65ea3c0346cd57a40303cddf4d35b5a.tar.bz2
fetchmail-0e6a306ee65ea3c0346cd57a40303cddf4d35b5a.zip
Don't pass bogus SIZEs.
svn path=/trunk/; revision=1448
-rw-r--r--driver.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/driver.c b/driver.c
index c548fafd..e6ddd04a 100644
--- a/driver.c
+++ b/driver.c
@@ -501,10 +501,11 @@ static int stuffline(struct query *ctl, char *buf)
return(n);
}
-static int readheaders(sock, len, ctl, realname, num)
+static int readheaders(sock, fetchlen, reallen, ctl, realname, num)
/* read message headers and ship to SMTP or MDA */
int sock; /* to which the server is connected */
-long len; /* length of message */
+long fetchlen; /* length of message according to fetch response */
+long reallen; /* length of message according to getsizes */
struct query *ctl; /* query control record */
char *realname; /* real name of host */
int num; /* index of message */
@@ -537,7 +538,7 @@ int num; /* index of message */
oldlen = 0;
msglen = 0;
- for (remaining = len; remaining > 0 || protocol->delimited; remaining -= linelen)
+ for (remaining = fetchlen; remaining > 0 || protocol->delimited; remaining -= linelen)
{
char *line;
@@ -927,8 +928,8 @@ int num; /* index of message */
else if (!strcasecmp(ctt,"8BIT"))
sprintf(options, " BODY=8BITMIME");
}
- if ((ctl->server.esmtp_options & ESMTP_SIZE))
- sprintf(options + strlen(options), " SIZE=%ld", len);
+ if ((ctl->server.esmtp_options & ESMTP_SIZE) && reallen > 0)
+ sprintf(options + strlen(options), " SIZE=%ld", reallen);
/*
* If there is a Return-Path address on the message, this was
@@ -1730,7 +1731,8 @@ const struct method *proto; /* protocol method table */
* Read the message headers and ship them to the
* output sink.
*/
- ok = readheaders(sock, len, ctl, realname, num);
+ ok = readheaders(sock, len, msgsizes[num-1],
+ ctl, realname, num);
if (ok == PS_RETAINED)
suppress_forward = retained = TRUE;
else if (ok == PS_TRANSIENT)