]>
diplodocus.org Git - nmh/blob - test/mhlist/test-ext-params
2 ######################################################
4 # Test mhlist with extended parameters (RFC 2231)
6 ######################################################
10 if test -z "${MH_OBJ_DIR}"; then
11 srcdir
=`dirname $0`/..
/..
12 MH_OBJ_DIR
=`cd $srcdir && pwd`; export MH_OBJ_DIR
15 .
"$MH_OBJ_DIR/test/common.sh"
19 require_locale en_US.utf
-8 en_US.utf8
20 LC_ALL
=en_US.UTF
-8; export LC_ALL
22 expected
=$MH_TEST_DIR/$$.expected
23 actual
=$MH_TEST_DIR/$$.actual
26 # Write a message with some extended parameters
31 To: recipient@example.com
32 From: sender@example.com
33 Subject: mhlist ext param test 1
35 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
38 Content-Type: text/plain; charset=us-ascii;
39 name*=utf-8''This%20%C3%AFs%20the%20filename
44 Content-Type: image/jpeg;
45 name*0="This is an example of a very long filename. I wonder ";
47 name*2=" this filename might be too long. It should not be. But";
48 name*3=" will it be?.jpg"
49 Content-Disposition: attachment;
50 filename*0="This is an example of a very long filename. I wonder ";
52 filename*2=" this filename might be too long. It should not be. But";
53 filename*3=" will it be?.jpg"
54 Content-Transfer-Encoding: base64
58 ------- =_aaaaaaaaaa0--
61 # check to see if we decode parameters correctly.
63 run_test
'mhlist last -noheader -verbose -disposition' \
64 ' 11 multipart/mixed 637
65 boundary="----- =_aaaaaaaaaa0"
68 name="This ïs the filename"
70 name="This is an example of a very long filename. I wonder if this filename might be too long. It should not be. But will it be?.jpg"
71 disposition "attachment"
72 filename="This is an example of a very long filename. I wonder if this filename might be too long. It should not be. But will it be?.jpg"'
75 # Make some more complicated message parameters.
80 To: recipient@example.com
81 From: sender@example.com
82 Subject: mhlist ext param test 2
84 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
87 Content-Type: text/plain; charset=us-ascii;
88 name*=utf-8''This%20%C3%AFs%20the%20filename
93 Content-Type: image/jpeg; name*3=" will it be?.jpg";
94 longparam*5*=Sp%C4%B1n%CC%88al%20Tap!;
95 longparam*2=It; name*1=if;
96 longparam*3=" Might be our Long Lost Band";
97 longparam*0*=UTF-8'en'I%20Cannot%20Believe%20It;
98 name*0="This is an example of a very long filename. I wonder ";
99 longparam*4*=%20The%20%C3%96ne%20And%20Only%20;
100 name*2=" this filename might be too long. It should not be. But";
101 longparam*1=", it Looks Like "
102 Content-Transfer-Encoding: base64
106 ------- =_aaaaaaaaaa0--
109 run_test
'mhlist last -noheader -verbose' \
110 ' 12 multipart/mixed 647
111 boundary="----- =_aaaaaaaaaa0"
114 name="This ïs the filename"
116 longparam="I Cannot Believe It, it Looks Like It Might be our Long Lost Band The Öne And Only Spın̈al Tap!"
117 name="This is an example of a very long filename. I wonder if this filename might be too long. It should not be. But will it be?.jpg"'
120 # Test out message/external-body types, and also make sure we will correctly
121 # decode a URL wrapped with RFC 2017 rules.
126 To: recipient@example.com
127 From: sender@example.com
128 Subject: mhlist ext param test 3
130 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
132 ------- =_aaaaaaaaaa0
133 Content-Type: text/plain; charset=us-ascii;
134 name*=utf-8''This%20%C3%AFs%20the%20filename
138 ------- =_aaaaaaaaaa0
139 Content-Type: message/external-body; access-type="url";
140 url*1="/that/should-be-wrapped/image.jpeg";
141 url*0="http://www.kremvax.ru/this/is/an/example/of/a/very/long/url"
143 Content-Type: image/jpeg
144 Content-Description: Test of a long URL
145 Content-Disposition: attachment; filename=image.jpeg
147 ------- =_aaaaaaaaaa0
148 Content-Type: message/external-body; access-type="url";
149 url*0="http://www.kremvax.ru/this/is/an/example/of/a/very/long/url
150 /that/should-be-wrapped/image.jpeg"
152 Content-Type: image/jpeg
153 Content-Description: Test of a long URL
154 Content-Disposition: attachment; filename=image.jpeg
156 ------- =_aaaaaaaaaa0--
159 run_test
'mhlist last -noheader -verbose -disposition' \
160 ' 13 multipart/mixed 775
161 boundary="----- =_aaaaaaaaaa0"
164 name="This ïs the filename"
165 2 message/external-body 118
167 url="http://www.kremvax.ru/this/is/an/example/of/a/very/long/url/that/should-be-wrapped/image.jpeg"
168 url="http://www.kremvax.ru/this/is/an/example/of/a/very/long/url/that/should-be-wrapped/image.jpeg"
170 image/jpeg Test of a long URL
171 disposition "attachment"
172 filename="image.jpeg"
173 3 message/external-body 118
175 url="http://www.kremvax.ru/this/is/an/example/of/a/very/long/url /that/should-be-wrapped/image.jpeg"
176 url="http://www.kremvax.ru/this/is/an/example/of/a/very/long/url/that/should-be-wrapped/image.jpeg"
178 image/jpeg Test of a long URL
179 disposition "attachment"
180 filename="image.jpeg"'