]> diplodocus.org Git - nmh/blob - test/mhlist/test-ext-params
Some tests for RFC 2231 decoding; seems like it works, but need to stress
[nmh] / test / mhlist / test-ext-params
1 #!/bin/sh
2 ######################################################
3 #
4 # Test mhlist with extended parameters (RFC 2231)
5 #
6 ######################################################
7
8 set -e
9
10 if test -z "${MH_OBJ_DIR}"; then
11 srcdir=`dirname $0`/../..
12 MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR
13 fi
14
15 . "$MH_OBJ_DIR/test/common.sh"
16
17 setup_test
18
19 expected=$MH_TEST_DIR/$$.expected
20 actual=$MH_TEST_DIR/$$.actual
21 LC_ALL=en_US.UTF-8; export LC_ALL
22
23 #
24 # Write a message with some extended parameters
25 #
26
27 msgfile=`mhpath new`
28 cat > $msgfile <<EOF
29 To: recipient@example.com
30 From: sender@example.com
31 Subject: mhlist ext param test 1
32 MIME-Version: 1.0
33 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
34
35 ------- =_aaaaaaaaaa0
36 Content-Type: text/plain; charset=us-ascii;
37 name*=utf-8''This%20%C3%AFs%20the%20filename
38
39 This is a test
40
41 ------- =_aaaaaaaaaa0
42 Content-Type: image/jpeg;
43 name*0="This is an example of a very long filename. I wonder ";
44 name*1=if;
45 name*2=" this filename might be too long. It should not be. But";
46 name*3=" will it be?.jpg"
47 Content-Disposition: attachment;
48 filename*0="This is an example of a very long filename. I wonder ";
49 filename*1=if;
50 filename*2=" this filename might be too long. It should not be. But";
51 filename*3=" will it be?.jpg"
52 Content-Transfer-Encoding: base64
53
54 /9g=
55
56 ------- =_aaaaaaaaaa0--
57 EOF
58
59 # check to see if we decode parameters correctly.
60
61 run_test 'mhlist last -noheader -verbose' \
62 ' 11 multipart/mixed 637
63 boundary="----- =_aaaaaaaaaa0"
64 1 text/plain 15
65 charset="us-ascii"
66 name="This ïs the filename"
67 2 image/jpeg 2
68 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"'
69
70 exit $failed