aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2006-07-31 10:53:59 +0000
committerMatthias Andree <matthias.andree@gmx.de>2006-07-31 10:53:59 +0000
commit966e8b1a1f8d803131c9b5484e2dc19fa1da0f4a (patch)
tree00bafabef6a396955cdb23fa9b805a3c9e1223ce
parent7748b5fd7d250d5b13c2c58c5a5de9541b313512 (diff)
downloadfetchmail-966e8b1a1f8d803131c9b5484e2dc19fa1da0f4a.tar.gz
fetchmail-966e8b1a1f8d803131c9b5484e2dc19fa1da0f4a.tar.bz2
fetchmail-966e8b1a1f8d803131c9b5484e2dc19fa1da0f4a.zip
Detect write errors when stuffing delimiter line between header and body.
Correct error message when copying message text fails. Fix a comment that falsely asserts we were generating invalid Received: headers. svn path=/branches/BRANCH_6-3/; revision=4869
-rw-r--r--transact.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/transact.c b/transact.c
index ba84f47d..b16f4238 100644
--- a/transact.c
+++ b/transact.c
@@ -1176,8 +1176,8 @@ int readheaders(int sock,
if (n != -1)
{
/*
- * This header is technically invalid under RFC822.
- * POP3, IMAP, etc. are not legal mail-parameter values.
+ * We SHOULD (RFC-2821 sec. 4.4/p. 53) make sure to only use
+ * IANA registered protocol names here.
*/
snprintf(buf, sizeof(buf),
"\tby %s with %s (fetchmail-%s",
@@ -1305,9 +1305,12 @@ int readheaders(int sock,
*cp++ = '\r';
*cp++ = '\n';
*cp++ = '\0';
- stuffline(ctl, buf);
+ n = stuffline(ctl, buf);
- return(PS_SUCCESS);
+ if (n == strlen(buf))
+ return PS_SUCCESS;
+ else
+ return PS_SOCKET;
}
int readbody(int sock, struct query *ctl, flag forward, int len)
@@ -1418,7 +1421,7 @@ int readbody(int sock, struct query *ctl, flag forward, int len)
if (n < 0)
{
- report(stdout, GT_("writing message text\n"));
+ report(stdout, GT_("error writing message text\n"));
release_sink(ctl);
return(PS_IOERR);
}