]>
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"
108 To: Mr Test <mrtest@example.com>
112 This is a test message
113 #image/jpeg {attachment; filename="This is an ëxample of a rather long filename that is longer than would fit on a normal line.jpg"} \
114 ${srcdir}/test/mhbuild/tiny.jpg
117 run_prog mhbuild
"$draft"
119 cat > "$expected" <<EOF
120 To: Mr Test <mrtest@example.com>
124 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
126 ------- =_aaaaaaaaaa0
127 Content-Type: text/plain; charset="us-ascii"
129 This is a test message
131 ------- =_aaaaaaaaaa0
132 Content-Type: image/jpeg
133 Content-Disposition: attachment;
134 filename*0*=UTF-8''This%20is%20an%20%C3%ABxample%20of%20a%20rather;
135 filename*1=" long filename that is longer than would fit on a norma";
136 filename*2="l line.jpg"
137 Content-Transfer-Encoding: base64
141 ------- =_aaaaaaaaaa0--
144 check
"$draft" "$expected"