]> diplodocus.org Git - nmh/blobdiff - test/mhbuild/test-ext-params
Switch over get_ctinfo() to determine the filename based on the filename if
[nmh] / test / mhbuild / test-ext-params
index a6c4b1299a3cf9005e9b8acd4fd669853d05b3c2..96cad2e93435006a5b70dd05520da36258c032e3 100755 (executable)
@@ -58,4 +58,127 @@ EOF
 
 check "$draft" "$expected"
 
 
 check "$draft" "$expected"
 
+#
+# Try out a draft with some long parameters
+#
+
+cat > "$draft" <<EOF
+To: Mr Test <mrtest@example.com>
+cc:
+Fcc: +outbox
+------
+This is a test message
+#image/jpeg {attachment; filename="This is an example of a rather long filename that is longer than would fit on a normal line.jpg"} \
+${srcdir}/test/mhbuild/tiny.jpg
+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: image/jpeg
+Content-Disposition: attachment;
+       filename*0="This is an example of a rather long filename that is lo";
+       filename*1="nger than would fit on a normal line.jpg"
+Content-Transfer-Encoding: base64
+
+/9g=
+
+------- =_aaaaaaaaaa0--
+EOF
+
+check "$draft" "$expected"
+
+#
+# Try out attach with a filename with 8-bit characters
+#
+
+cp "${srcdir}/test/mhbuild/tiny.jpg" "$MH_TEST_DIR/tïny.jpg"
+
+cat > "$draft" <<EOF
+To: Mr Test <mrtest@example.com>
+cc:
+Fcc: +outbox
+Attach: $MH_TEST_DIR/tïny.jpg
+------
+This is a test message
+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: image/jpeg; name*=UTF-8''t%C3%AFny.jpg
+Content-Description: =?UTF-8?B?dMOvbnkuanBn?=
+Content-Disposition: attachment; filename*=UTF-8''t%C3%AFny.jpg
+Content-Transfer-Encoding: base64
+
+/9g=
+
+------- =_aaaaaaaaaa0--
+EOF
+
+check "$draft" "$expected"
+
+#
+# Alternate version; specify a disposion, but not an explicit filename
+#
+
+cat > "$draft" <<EOF
+To: Mr Test <mrtest@example.com>
+cc:
+Fcc: +outbox
+------
+This is a test message
+#image/jpeg {attachment} $MH_TEST_DIR/tïny.jpg
+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: image/jpeg
+Content-Disposition: attachment; filename*=UTF-8''t%C3%AFny.jpg
+Content-Transfer-Encoding: base64
+
+/9g=
+
+------- =_aaaaaaaaaa0--
+EOF
+
+check "$draft" "$expected"
+
 exit ${failed:-0}
 exit ${failed:-0}