]>
diplodocus.org Git - nmh/blob - test/mhbuild/test-ext-params
2 ######################################################
4 # Test the creation of RFC 2231 encoded parameters
6 ######################################################
8 if test -z "${MH_OBJ_DIR}"; then
9 srcdir
=`dirname "$0"`/..
/..
10 MH_OBJ_DIR
=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
13 .
"$MH_OBJ_DIR/test/common.sh"
17 LC_ALL
=en_US.UTF
-8; export LC_ALL
19 draft
="$MH_TEST_DIR/$$.draft"
20 expected
="$MH_TEST_DIR/$$.expected"
23 # Try out a draft with some 8-bit encoded parameters
27 To: Mr Test <mrtest@example.com>
31 This is a test message
32 #image/jpeg {attachment; filename="tïny.jpg"} ${srcdir}/test/mhbuild/tiny.jpg
35 run_prog mhbuild
"$draft"
37 cat > "$expected" <<EOF
38 To: Mr Test <mrtest@example.com>
42 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
45 Content-Type: text/plain; charset="us-ascii"
47 This is a test message
50 Content-Type: image/jpeg
51 Content-Disposition: attachment; filename*=UTF-8''t%C3%AFny.jpg
52 Content-Transfer-Encoding: base64
56 ------- =_aaaaaaaaaa0--
59 check
"$draft" "$expected"
62 # Try out a draft with some long parameters
66 To: Mr Test <mrtest@example.com>
70 This is a test message
71 #image/jpeg {attachment; filename="This is an example of a rather long filename that is longer than would fit on a normal line.jpg"} \
72 ${srcdir}/test/mhbuild/tiny.jpg
75 run_prog mhbuild
"$draft"
77 cat > "$expected" <<EOF
78 To: Mr Test <mrtest@example.com>
82 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
85 Content-Type: text/plain; charset="us-ascii"
87 This is a test message
90 Content-Type: image/jpeg
91 Content-Disposition: attachment;
92 filename*0="This is an example of a rather long filename that is lo";
93 filename*1="nger than would fit on a normal line.jpg"
94 Content-Transfer-Encoding: base64
98 ------- =_aaaaaaaaaa0--
101 check
"$draft" "$expected"
104 # Try out attach with a filename with 8-bit characters
107 cp "${srcdir}/test/mhbuild/tiny.jpg" "$MH_TEST_DIR/tïny.jpg"
110 To: Mr Test <mrtest@example.com>
113 Attach: $MH_TEST_DIR/tïny.jpg
115 This is a test message
118 run_prog mhbuild
"$draft"
120 cat > "$expected" <<EOF
121 To: Mr Test <mrtest@example.com>
125 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
127 ------- =_aaaaaaaaaa0
128 Content-Type: text/plain; charset="us-ascii"
130 This is a test message
132 ------- =_aaaaaaaaaa0
133 Content-Type: image/jpeg; name*=UTF-8''t%C3%AFny.jpg
134 Content-Description: =?UTF-8?B?dMOvbnkuanBn?=
135 Content-Disposition: attachment; filename*=UTF-8''t%C3%AFny.jpg
136 Content-Transfer-Encoding: base64
140 ------- =_aaaaaaaaaa0--
143 check
"$draft" "$expected"