]> diplodocus.org Git - nmh/blobdiff - test/mhbuild/test-ext-params
Treat unknown top-level content types as "application" types, instead
[nmh] / test / mhbuild / test-ext-params
index 96cad2e93435006a5b70dd05520da36258c032e3..adde9d958da27bf0fba2e8c2f7c0f4833b0695b2 100755 (executable)
@@ -17,6 +17,7 @@ setup_test
 LC_ALL=en_US.UTF-8; export LC_ALL
 
 draft="$MH_TEST_DIR/$$.draft"
+backup="${MH_TEST_DIR}/`mhparam sbackup`$$.draft.orig"
 expected="$MH_TEST_DIR/$$.expected"
 
 #
@@ -156,6 +157,7 @@ This is a test message
 EOF
 
 run_prog mhbuild "$draft"
+rm -f "$MH_TEST_DIR/tïny.jpg"
 
 cat > "$expected" <<EOF
 To: Mr Test <mrtest@example.com>
@@ -181,4 +183,48 @@ EOF
 
 check "$draft" "$expected"
 
+#
+# Test out message/external-body decoding
+#
+
+cat > "$draft" <<EOF
+To: Mr Test <mrtest@example.com>
+cc:
+Fcc: +outbox
+------
+This is a test message
+#@application/octet-stream [Test of a long URL] {attachment; \
+filename=test.tar.gz} access-type=url; url="http://www.example.com/this/is/an/example/of/a/very/long/url/that-should-be-wrapped/name.tar.gz"
+EOF
+
+run_prog mhbuild "$draft"
+
+cat > "$expected" <<EOF
+To: Mr Test <mrtest@example.com>
+cc:
+Fcc: +outbox
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
+
+------- =_aaaaaaaaaa0
+Content-Type: text/plain; charset="us-ascii"
+
+This is a test message
+
+------- =_aaaaaaaaaa0
+Content-Type: message/external-body; access-type="url";
+       url*0="http://www.example.com/this/is/an/example/of/a/very/long/url";
+       url*1="/that-should-be-wrapped/name.tar.gz"
+
+Content-Type: application/octet-stream
+Content-Description: Test of a long URL
+Content-Disposition: attachment; filename="test.tar.gz"
+
+------- =_aaaaaaaaaa0--
+EOF
+
+check "$draft" "$expected"
+
+[ ${failed:=0} -eq 0 ]  &&  rm -f ${backup}
+
 exit ${failed:-0}