]>
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@ex
42 12+ 09/28 Mister Burster Message one<<- - This line should not be unstuff\
46 # Create another test message that does multipart/digest checking
49 cat > "${MH_TEST_DIR}/Mail/inbox/14" <<EOF
50 From: Test Burst Message <burst1@example.com>
51 To: Test Recipient <recipient@example.com>
52 Date: Friday, 29 Sep 2006 00:00:00
55 Content-Type: multipart/digest; boundary="----- =_aaaaaaaaaa0"
59 Content-Type: message/rfc822
61 From: Mister Burster <burst2@example.com>
62 To: Nobody 1 <nobody1@example.com>
63 Date: Thursday, 28 Sep 2006 00:01:00
66 - -This is message one
70 From: Mister Burster <burst3@example.com>
71 To: Nobody 2 <nobody2@example.com>
72 Date: Thursday, 28 Sep 2006 00:02:00
79 From: Mister Burster <burst4@example.com>
80 To: Nobody 3 <nobody3@example.com>
81 Date: Thursday, 28 Sep 2006 00:03:00
82 Subject: Message three
87 ------- =_aaaaaaaaaa0--
90 run_prog burst
14 || exit
92 run_test
'scan -width 80 14-last' "\
93 14 09/29 Test Burst Messag Test digest<<This is a preamble ------- =_aaaaaaa
94 15+ 09/28 Mister Burster Message one<<- -This is message one >>
95 16 09/28 Mister Burster Message two<<This is message two - For real.>>
96 17 09/28 Mister Burster Message three<<Will this one work? >>"
99 # Check to see if each message is what we expect
102 run_test
'show -noheader -noshow 15' \
103 "From: Mister Burster <burst2@example.com>
104 To: Nobody 1 <nobody1@example.com>
105 Date: Thursday, 28 Sep 2006 00:01:00
108 - -This is message one"
110 run_test
'show -noheader -noshow 16' \
111 "From: Mister Burster <burst3@example.com>
112 To: Nobody 2 <nobody2@example.com>
113 Date: Thursday, 28 Sep 2006 00:02:00
120 # The CR/LF that appears right before the boundary line is considered part
121 # of the boundary line, so this has the practical effect of "eating" a
122 # blank line if it's before the boundary (RFC 2046. 5.1.1). So make sure
123 # a double blank line results in only one blank line at the end of a message.
126 expected
="${MH_TEST_DIR}/$$.expected"
127 cat > "${expected}" <<EOF
128 From: Mister Burster <burst4@example.com>
129 To: Nobody 3 <nobody3@example.com>
130 Date: Thursday, 28 Sep 2006 00:03:00
131 Subject: Message three
137 check
"${expected}" `mhpath 17`