aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS4
-rw-r--r--driver.c18
2 files changed, 18 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index 03d28914..deaa2b02 100644
--- a/NEWS
+++ b/NEWS
@@ -42,11 +42,13 @@ bugs --
Carey Evans <c.evans@student.canterbury.ac.nz> for pointing out these
problems.
+* Handle zero-length messages properly; thanks to Bob Craycroft.
+
Note: the RFC subdirectory is no longer included with the distribution
(this cut its size in half!) Instead, applicable RFCs are listed on the
manual page.
-There are 199 people on the fetchmail-friends list.
+There are 200 people on the fetchmail-friends list.
------------------------------------------------------------------------------
fetchmail-2.8 (Sat Jan 11 15:48:33 EST 1997)
diff --git a/driver.c b/driver.c
index 0fd2b145..5c3f926f 100644
--- a/driver.c
+++ b/driver.c
@@ -474,9 +474,11 @@ char *realname; /* real name of host */
received_for = parse_received(ctl, bufp);
#endif /* HAVE_RES_SEARCH */
- continue;
- }
- else if (headers) /* OK, we're at end of headers now */
+ if (len > 0)
+ continue;
+ } /* if (inheaders) */
+
+ if (headers && (!inheaders || len == 0)) /* at end of headers now */
{
char *cp;
struct idlist *idp, *xmit_names;
@@ -713,6 +715,16 @@ char *realname; /* real name of host */
}
free_str_list(&xmit_names);
+ } /* else if (headers) */
+
+ /* output a crlf if zero length message body */
+ if (!len && inheaders)
+ {
+ if (ctl->mda[0])
+ fputs("\r\n", sinkfp);
+ else if (sinkfp)
+ SockWrite("\r\n", 1, 2, sinkfp);
+ continue;
}
/* following code is executed on non-header lines only */