decode rfc2047 header in mhparse
[mmh] / test / tests / mhstore / test-filenames
1 #!/bin/sh
2 ######################################################
3 #
4 # Test filenames
5 #
6 ######################################################
7
8 . "$MH_TEST_COMMON"
9
10 require_locale en_US.utf-8 en_US.utf8
11 LC_ALL=en_US.UTF-8
12 export LC_ALL
13
14 tempdir=`TMPDIR=$MH_TEST_DIR mktemp -d -t "XXXXX"`
15 cd $tempdir
16
17 msgfile=`mhpath b`
18 cat > $msgfile <<EOF
19 To: recipient@example.com
20 From: sender@example.com
21 Subject: mhlist test
22 MIME-Version: 1.0
23 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
24
25 ------- =_aaaaaaaaaa0
26 Content-Type: multipart/related;
27     type="multipart/alternative";
28     boundary="subpart__1.1"
29
30 --subpart__1.1
31 Content-Type: text/plain; charset="iso-8859-1"
32 Content-Disposition: attachment; filename="=?UTF-8?B?YmzDpGIudHh0?="
33
34 This is the first text/plain part, in a subpart.
35
36 --subpart__1.1--
37
38 ------- =_aaaaaaaaaa0
39 Content-Type: text/plain; charset="iso-8859-1"
40 Content-Disposition: attachment; filename="=?UTF-8?Q?bl=C3=A4.txt?="
41 Content-MD5: kq+Hnc2SD/eKwAnkFBDuEA==
42 Content-Transfer-Encoding: quoted-printable
43
44 This is the second text/plain part.
45
46 ------- =_aaaaaaaaaa0
47 Content-Type: text/plain; charset="iso-8859-1"; name="test3"
48 Content-Disposition: attachment;
49
50 This is the third text/plain part.
51
52 ------- =_aaaaaaaaaa0
53 Content-Type: text/plain; charset="iso-8859-1"
54 Content-Disposition: attachment; filename="test4"
55 Content-Transfer-Encoding: base64
56
57 VGhpcyBpcyB0aGUgZm91cnRoIHRleHQvcGxhaW4gcGFydC4K
58
59 ------- =_aaaaaaaaaa0
60 Content-Type: text/plain; charset="iso-8859-1"; name="test23"
61 Content-Disposition: attachment; filename="test5"
62
63 This is the third text/plain part.
64
65 ------- =_aaaaaaaaaa0
66 Content-Type: text/plain; charset="iso-8859-1"
67 Content-Disposition: attachment;
68
69 This is the third text/plain part.
70
71 ------- =_aaaaaaaaaa0--
72 EOF
73
74 msgnum=`pick l`
75
76 runandcheck "mhstore l" <<!
77 storing message $msgnum part 1.1 as file bläb.txt
78 storing message $msgnum part 2 as file blä.txt
79 storing message $msgnum part 3 as file test3
80 storing message $msgnum part 4 as file test4
81 storing message $msgnum part 5 as file test5
82 storing message $msgnum part 6 as file $msgnum.6.plain
83 !
84
85 cd $OLDPWD
86 rm -rf $tempdir