]>
diplodocus.org Git - nmh/blob - test/burst/test-burst-mime
3 # Tests to see if bursting MIME messages works correctly.
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"
18 # Create a one-part test message that we can burst
21 cat > "${MH_TEST_DIR}/Mail/inbox/11" <<EOF
22 From: Test Burst Message <burst1@example.com>
23 To: Test Recipient <recipient@example.com>
24 Date: Friday, 29 Sep 2006 00:00:00
25 Subject: Test MIME digest
27 Content-type: message/rfc822
29 From: Mister Burster <burst2@example.com>
30 To: Nobody 1 <nobody1@example.com>
31 Date: Thursday, 28 Sep 2006 00:01:00
34 - - This line should not be unstuffed
40 run_test
'scan -width 80 11-last' \
41 " 11 09/29 Test Burst Messag Test MIME digest<<From: Mister Burster <burst2@e
42 12+ 09/28 Mister Burster Message one<<- - This line should not be unstuff"
45 # Create another test message that does multipart/digest checking
48 cat > "${MH_TEST_DIR}/Mail/inbox/14" <<EOF
49 From: Test Burst Message <burst1@example.com>
50 To: Test Recipient <recipient@example.com>
51 Date: Friday, 29 Sep 2006 00:00:00
54 Content-Type: multipart/digest; boundary="----- =_aaaaaaaaaa0"
58 Content-Type: message/rfc822
60 From: Mister Burster <burst2@example.com>
61 To: Nobody 1 <nobody1@example.com>
62 Date: Thursday, 28 Sep 2006 00:01:00
65 - -This is message one
69 From: Mister Burster <burst3@example.com>
70 To: Nobody 2 <nobody2@example.com>
71 Date: Thursday, 28 Sep 2006 00:02:00
78 From: Mister Burster <burst4@example.com>
79 To: Nobody 3 <nobody3@example.com>
80 Date: Thursday, 28 Sep 2006 00:03:00
81 Subject: Message three
86 ------- =_aaaaaaaaaa0--
89 run_prog burst
14 || exit
91 run_test
'scan -width 80 14-last' \
92 " 14 09/29 Test Burst Messag Test digest<<This is a preamble ------- =_aaaaaa
93 15+ 09/28 Mister Burster Message one<<- -This is message one >>
94 16 09/28 Mister Burster Message two<<This is message two - For real.>>
95 17 09/28 Mister Burster Message three<<Will this one work? >>"
98 # Check to see if each message is what we expect
101 run_test
'show -noheader -noshow 15' \
102 "From: Mister Burster <burst2@example.com>
103 To: Nobody 1 <nobody1@example.com>
104 Date: Thursday, 28 Sep 2006 00:01:00
107 - -This is message one"
109 run_test
'show -noheader -noshow 16' \
110 "From: Mister Burster <burst3@example.com>
111 To: Nobody 2 <nobody2@example.com>
112 Date: Thursday, 28 Sep 2006 00:02:00
119 # The CR/LF that appears right before the boundary line is considered part
120 # of the boundary line, so this has the practical effect of "eating" a
121 # blank line if it's before the boundary (RFC 2046. 5.1.1). So make sure
122 # a double blank line results in only one blank line at the end of a message.
125 expected
="${MH_TEST_DIR}/$$.expected"
126 cat > "${expected}" <<EOF
127 From: Mister Burster <burst4@example.com>
128 To: Nobody 3 <nobody3@example.com>
129 Date: Thursday, 28 Sep 2006 00:03:00
130 Subject: Message three
136 check
"${expected}" `mhpath 17`