summaryrefslogtreecommitdiffstats
path: root/maildrop/testsuite2
diff options
context:
space:
mode:
authorSam Varshavchik2018-02-16 20:54:41 -0500
committerSam Varshavchik2018-02-16 21:19:05 -0500
commitc6c18e6142360a30cc11bfe29ac8b762e99a2104 (patch)
treeee18c5fcb707c5d230950dd57e4ae619e3bd38b0 /maildrop/testsuite2
parent8b4fcc3895ca8243e200c15cd089323a482cad13 (diff)
downloadcourier-libs-c6c18e6142360a30cc11bfe29ac8b762e99a2104.tar.bz2
maildrop: Add :H pattern modifier to maildrop.
rfc2045: RFC2045_DECODEMSG_NOATTACHHEADERS flag, do not decode attachment headers. maildrop: The ":H" pattern modifier searches main headers only, does not search attachments' headers.
Diffstat (limited to 'maildrop/testsuite2')
-rw-r--r--maildrop/testsuite260
1 files changed, 60 insertions, 0 deletions
diff --git a/maildrop/testsuite2 b/maildrop/testsuite2
index 1a87854..ae5bbf1 100644
--- a/maildrop/testsuite2
+++ b/maildrop/testsuite2
@@ -261,4 +261,64 @@ then
exit 1
fi
+cat >testsuite.msg <<EOF
+Subject: mainpart
+Mime-Version: 1.0
+Content-Type: multipart/mixed; boundary="zz"
+
+--zzz
+Subject: attachmentpart
+
+body
+
+--zzz--
+EOF
+
+cat >testsuite1.filter <<EOF
+if (/body/)
+{
+ echo "Should not have found the body"
+ EXITCODE=1
+}
+
+if (!/body/:b)
+{
+ echo "Should have found the body"
+ EXITCODE=1
+}
+
+if (!(/^Subject: mainpart/ && /^Subject: mainpart/))
+{
+ echo "all header search 1 failed"
+ EXITCODE=1
+}
+
+if (!(/^Subject: mainpart/:h && /^Subject: mainpart/:h))
+{
+ echo "all header search 2 failed"
+ EXITCODE=1
+}
+
+if (!/^Subject: mainpart/:H)
+{
+ echo "mainpart search failed"
+ EXITCODE=1
+}
+
+if (/^Subject: attachmentpart/:H)
+{
+ echo "attachment search should have failed"
+ EXITCODE=1
+}
+exit
+EOF
+
+if ./maildrop ./testsuite1.filter <testsuite.msg
+then
+ :
+else
+ echo "header/body test failed"
+ exit 1
+fi
+
rm -f testsuite?.filter testsuite.msg