diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1997-01-21 23:27:48 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1997-01-21 23:27:48 +0000 |
commit | ae64c4a3538005d50f2bf3067b48e6865f57bfda (patch) | |
tree | c0d3ef81a5bd61f6399c26f99045a56f5bacd955 /driver.c | |
parent | 141ce45877763341f3218b22da8fa0fcdb3bbb43 (diff) | |
download | fetchmail-ae64c4a3538005d50f2bf3067b48e6865f57bfda.tar.gz fetchmail-ae64c4a3538005d50f2bf3067b48e6865f57bfda.tar.bz2 fetchmail-ae64c4a3538005d50f2bf3067b48e6865f57bfda.zip |
Handle zero-length messages.
svn path=/trunk/; revision=799
Diffstat (limited to 'driver.c')
-rw-r--r-- | driver.c | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -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 */ |