summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--maildrop/testsuite220
-rw-r--r--rfc2045/rfc2045.c6
2 files changed, 26 insertions, 0 deletions
diff --git a/maildrop/testsuite2 b/maildrop/testsuite2
index e63768b..8d08e1b 100644
--- a/maildrop/testsuite2
+++ b/maildrop/testsuite2
@@ -240,4 +240,24 @@ do
done
runtest " with xfilter"
+
+cat >testsuite.msg <<EOF
+X-Spam-Flag: yes
+EOF
+cat >testsuite1.filter <<EOF
+EXITCODE=0
+if (/^X-Spam-Flag/)
+{
+ EXITCODE=1
+}
+EOF
+
+chmod 600 testsuite1.filter
+
+if ./maildrop ./testsuite1.filter <testsuite.msg
+then
+ echo "bodyless message test failed"
+ exit 1
+fi
+
rm -f testsuite?.filter testsuite.msg
diff --git a/rfc2045/rfc2045.c b/rfc2045/rfc2045.c
index 8cbd3a7..40c2017 100644
--- a/rfc2045/rfc2045.c
+++ b/rfc2045/rfc2045.c
@@ -652,6 +652,12 @@ int bit8=0;
update_counts(p, p->endpos + cnt, p->endpos+n, 1);
+ /*
+ ** Until we see an official start of message body, the body starts
+ ** right after what we just read.
+ */
+ p->startbody=p->endbody;
+
/* If this header line starts with a space, append one space
** to the saved contents of the previous line, and append this
** line to it.