2 ######################################################
6 ######################################################
11 # check with no options and no current message
14 runandcheck 'mhlist' <<!
19 # check with no options and current message
20 folder +inbox 5 > /dev/null
21 runandcheck mhlist <<!
22 msg part type/subtype size description
25 # FIXME: three should be no trailing spaces
29 # check with folder and current message
30 runandcheck "mhlist +inbox" <<!
31 msg part type/subtype size description
34 # FIXME: three should be no trailing spaces
36 # check with specified message
37 runandcheck "mhlist 5" <<!
38 msg part type/subtype size description
41 # FIXME: three should be no trailing spaces
45 runandcheck "mhlist -file $MH_TEST_DIR/Mail/inbox/5" <<!
46 msg part type/subtype size description
49 # FIXME: three should be no trailing spaces
52 runandcheck "mhlist -file - < $MH_TEST_DIR/Mail/inbox/5" <<!
53 msg part type/subtype size description
56 # FIXME: three should be no trailing spaces
59 # check message number greater than highest
60 runandcheck 'mhlist 11' <<!
61 mhlist: message 11 doesn't exist
65 # check multiple messages
66 runandcheck "mhlist 2 8" <<!
67 msg part type/subtype size description
73 # Write message with a text/plain subpart.
77 To: recipient@example.com
78 From: sender@example.com
81 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
84 Content-Type: multipart/related;
85 type="multipart/alternative";
86 boundary="subpart__1.1"
89 Content-Type: text/plain; charset="iso-8859-1"
90 Content-Disposition: attachment; filename="test1"
92 This is the first text/plain part, in a subpart.
97 Content-Type: text/plain; charset="iso-8859-1"
98 Content-Disposition: attachment; filename="test2"
99 Content-MD5: kq+Hnc2SD/eKwAnkFBDuEA==
100 Content-Transfer-Encoding: quoted-printable
102 This is the second text/plain part.
104 ------- =_aaaaaaaaaa0
105 Content-Type: text/plain; charset="iso-8859-1"; name="test3"
106 Content-Disposition: attachment; filename="test3"
108 This is the third text/plain part.
110 ------- =_aaaaaaaaaa0
111 Content-Type: text/plain; charset="iso-8859-1"
112 Content-Disposition: attachment; filename="test4"
113 Content-Transfer-Encoding: base64
115 VGhpcyBpcyB0aGUgZm91cnRoIHRleHQvcGxhaW4gcGFydC4K
117 ------- =_aaaaaaaaaa0--
121 runandcheck 'mhlist l -part 3' <<!
122 msg part type/subtype size description
123 11 multipart/mixed 936
124 1 multipart/related 180
129 # check -part of a subpart
130 runandcheck 'mhlist l -part 1.1' <<!
131 msg part type/subtype size description
132 11 multipart/mixed 936
133 1 multipart/related 180
139 runandcheck 'mhlist l -type text/plain' <<!
140 msg part type/subtype size description
141 11 multipart/mixed 936
142 1 multipart/related 180
153 runandcheck 'mhlist 11 -verbose' <<!
154 msg part type/subtype size description
155 11 multipart/mixed 936
156 boundary="----- =_aaaaaaaaaa0"
157 1 multipart/related 180
158 type="multipart/alternative"
159 boundary="subpart__1.1"
173 # check MIME parser and m_getfld
176 msgnum=`basename $msgfile`
178 To: recipient@example.com, recipient@example.com, recipient@example.com,
179 recipient@example.com, recipient@example.com, recipient@example.com,
180 recipient@example.com, recipient@example.com, recipient@example.com,
181 recipient@example.com, recipient@example.com, recipient@example.com,
182 recipient@example.com, recipient@example.com, recipient@example.com,
183 recipient@example.com, recipient@example.com, recipient@example.com,
184 recipient@example.com, recipient@example.com, recipient@example.com,
185 recipient@example.com, recipient@example.com, recipient@example.com,
186 recipient@example.com, recipient@example.com, recipient@example.com,
187 recipient@example.com, recipient@example.com, recipient@example.com,
188 recipient@example.com, recipient@example.com, recipient@example.com,
189 recipient@example.com, recipient@example.com, recipient@example.com,
190 recipient@example.com, recipient@example.com, recipient@example.com,
191 recipient@example.com, recipient@example.com, recipient@example.com,
192 recipient@example.com, recipient@example.com, recipient@example.com,
193 recipient@example.com, recipient@example.com, recipient@example.com,
194 recipient@example.com, recipient@example.com, recipient@example.com,
195 recipient@example.com, recipient@example.com, recipient@example.com,
196 recipient@example.com, recipient@example.com, recipient@example.com,
197 recipient@example.com, recipient@example.com, recipient@example.com,
198 recipient@example.com, recipient@example.com, recipient@example.com,
199 recipient@example.com, recipient@example.com, recipient@example.com,
200 recipient@example.com, recipient@example.com, recipient@example.com,
201 recipient@example.com, recipient@example.com, recipient@example.com,
202 recipient@example.com, recipient@example.com, recipient@example.com,
203 recipient@example.com, recipient@example.com, recipient@example.com,
204 recipient@example.com, recipient@example.com, recipient@example.com,
205 recipient@example.com, recipient@example.com, recipient@example.com,
206 recipient@example.com, recipient@example.com, recipient@example.com,
207 recipient@example.com, recipient@example.com, recipient@example.com,
208 recipient@example.com, recipient@example.com, recipient@example.com,
209 recipient@example.com, recipient@example.com, recipient@example.com,
210 recipient@example.com, recipient@example.com, recipient@example.com,
211 recipient@example.com, recipient@example.com, recipient@example.com,
212 recipient@example.com, recipient@example.com, recipient@example.com,
213 recipient@example.com, recipient@example.com, recipient@example.com,
214 recipient@example.com, recipient@example.com, recipient@example.com,
215 recipient@example.com, recipient@example.com, recipient@example.com,
216 recipient@example.com, recipient@example.com, recipient@example.com,
217 recipient@example.com, recipient@example.com, recipient@example.com,
218 recipient@example.com, recipient@example.com, recipient@example.com,
219 recipient@example.com, recipient@example.com, recipient@example.com,
220 recipient@example.com, recipient@example.com, recipient@example.com,
221 recipient@example.com, recipient@example.com, recipient@example.com,
222 recipient@example.com, recipient@example.com, recipient@example.com,
223 recipient@example.com, recipient@example.com, recipient@example.com,
224 recipient@example.com, recipient@example.com, recipient@example.com,
225 recipient@example.com, recipient@example.com, recipient@example.com,
226 recipient@example.com, recipient@example.com, recipient@example.com,
227 recipient@example.com, recipient@example.com, recipient@example.com,
228 recipient@example.com, recipient@example.com, recipient@example.com,
229 recipient@example.com, recipient@example.com, recipient@example.com,
230 recipient@example.com, recipient@example.com, recipient@example.com,
231 recipient@example.com, recipient@example.com, recipient@example.com,
232 recipient@example.com, recipient@example.com, recipient@example.com,
233 recipient@example.com, recipient@example.com, recipient@example.com,
234 recipient@example.com, recipient@example.com, recipient@example.com,
235 recipient@example.com, recipient@example.com, recipient@example.com,
236 recipient@example.com, recipient@example.com, recipient@example.com,
237 recipient@example.com, recipient@example.com, recipient@example.com,
238 recipient@example.com, recipient@example.com, recipient@example.com,
239 recipient@example.com, recipient@example.com, recipient@example.com,
240 recipient@example.com, recipient@example.com, recipient@example.com,
241 recipient@example.com, recipient@example.com, recipient@example.com,
242 recipient@example.com, recipient@example.com, recipient@example.com,
243 recipient@example.com, recipient@example.com, recipient@example.com,
244 recipient@example.com, recipient@example.com, recipient@example.com,
245 recipient@example.com, recipient@example.com, recipient@example.com,
246 recipient@example.com, recipient@example.com, recipient@example.com,
247 recipient@example.com, recipient@example.com, recipient@example.com,
248 recipient@example.com, recipient@example.com, recipient@example.com,
249 recipient@example.com, recipient@example.com, recipient@example.com,
250 recipient@example.com, recipient@example.com, recipient@example.com,
251 recipient@example.com, recipient@example.com, recipient@example.com,
252 recipient@example.com, recipient@example.com, recipient@example.com,
253 recipient@example.com, recipient@example.com, recipient@example.com,
254 recipient@example.com, recipient@example.com, recipient@example.com,
255 recipient@example.com, recipient@example.com, recipient@example.com,
256 recipient@example.com, recipient@example.com, recipient@example.com,
257 recipient@example.com, recipient@example.com, recipient@example.com,
258 recipient@example.com, recipient@example.com, recipient@example.com,
259 recipient@example.com, recipient@example.com, recipient@example.com,
260 recipient@example.com, recipient@example.com, recipient@example.com,
261 recipient@example.com, recipient@example.com, recipient@example.com,
262 recipient@example.com, recipient@example.com, recipient@example.com,
263 recipient@example.com, recipient@example.com, recipient@example.com,
264 recipient@example.com, recipient@example.com, recipient@example.com,
265 recipient@example.com, recipient@example.com, recipient@example.com,
266 recipient@example.com, recipient@example.com, recipient@example.com,
267 recipient@example.com, recipient@example.com, recipient@example.com,
268 recipient@example.com, recipient@example.com, recipient@example.com,
269 recipient@example.com, recipient@example.com, recipient@example.com,
270 recipient@example.com, recipient@example.com, recipient@example.com,
271 recipient@example.com, recipient@example.com, recipient@example.com,
272 recipient@example.com, recipient@example.com, recipient@example.com,
273 recipient@example.com, recipient@example.com, recipient@example.com,
274 recipient@example.com, recipient@example.com, recipient@example.com,
275 recipient@example.com, recipient@example.com, recipient@example.com,
276 recipient@example.com, recipient@example.com, recipient@example.com,
277 recipient@example.com, recipient@example.com, recipient@example.com,
278 recipient@example.com, recipient@example.com, recipient@example.com,
279 recipient@example.com, recipient@example.com, recipient@example.com,
280 recipient@example.com, recipient@example.com, recipient@example.com,
281 recipient@example.com, recipient@example.com, recipient@example.com,
282 recipient@example.com, recipient@example.com, recipient@example.com,
283 recipient@example.com, recipient@example.com, recipient@example.com,
284 recipient@example.com, recipient@example.com, recipient@example.com,
285 recipient@example.com, recipient@example.com, recipient@example.com,
286 recipient@example.com, recipient@example.com, recipient@example.com,
287 recipient@example.com, recipient@example.com, recipient@example.com,
288 recipient@example.com, recipient@example.com, recipient@example.com,
289 recipient@example.com, recipient@example.com, recipient@example.com,
291 From: sender@example.com
292 Subject: very long header
293 Date: Wed, 4 Dec 2013 21:12:00 -0500
295 Content-Type: multipart/related; boundary="1"
298 Content-Type: multipart/alternative; boundary="2"
301 Content-Type: text/plain; charset="us-ascii"
309 Content-Type: text/plain; charset="us-ascii"
317 runandcheck "mhlist l" <<!
318 msg part type/subtype size description
319 12 multipart/related 204
320 1 multipart/alternative 74
326 ## now check mhlist output
329 msgnum=`basename $msgfile`
331 To: example@example.org
332 From: someone <someone@example.com>
334 Date: Thu, 29 Jan 2015 18:12:21 +0000 (GMT)
335 Content-Type: multipart/mixed; boundary="BoundaryMixed"
338 Content-type: multipart/alternative;
339 boundary="BoundaryAlternative1"
341 --BoundaryAlternative1
342 Content-type: text/enriched; CHARSET=US-ASCII
343 Content-transfer-encoding: 7bit
345 This is supposedly enriched.
347 --BoundaryAlternative1
348 Content-type: text/plain; charset=ISO-8859-1; format=flowed
349 Content-transfer-encoding: 8bit
351 This is the body text/plain part.
353 --BoundaryAlternative1
354 Content-type: text/html; CHARSET=US-ASCII
355 Content-transfer-encoding: 7bit
357 <html><body><div><span style="line-height: 1.5;">
358 This is the text/html body part.
359 </span></div></body></html>
361 --BoundaryAlternative1--
364 Content-type: multipart/alternative;
365 boundary="BoundaryAlternative2"
367 --BoundaryAlternative2
368 Content-type: audio/wav
369 Content-transfer-encoding: 8bit
373 --BoundaryAlternative2
374 Content-type: audio/mp3
375 Content-transfer-encoding: 8bit
379 --BoundaryAlternative2
380 Content-type: audio/basic
381 Content-transfer-encoding: 8bit
385 --BoundaryAlternative2--
390 # check it -- vanilla output
391 runandcheck "mhlist $msgnum" <<!
392 msg part type/subtype size description
393 13 multipart/mixed 1038
394 1 multipart/alternative 518
398 2 multipart/alternative 326
405 # check it -- just part 1
406 runandcheck "mhlist -part 1 $msgnum" <<!
407 msg part type/subtype size description
408 13 multipart/mixed 1038
409 1 multipart/alternative 518
413 2 multipart/alternative 326
418 # check it -- ask for audio/basic in part 1, should get nothing
419 runandcheck "mhlist -part 1 -type audio/basic $msgnum" <<!
420 msg part type/subtype size description
421 13 multipart/mixed 1038
422 1 multipart/alternative 518
423 2 multipart/alternative 326