Fix spelling errors, including binaries ones
[mmh] / test / tests / send / test-mimeify
1 #Test if MIME conversion work
2
3 . "$MH_TEST_COMMON"
4
5 draft="$MH_TEST_DIR/send-$$.draft"
6
7 profile="$MMH/profile-send"
8 cd "$MMH"
9 cat "`mhparam profile`" - >"$profile" <<!
10 default-from: Bob <bob@example.org>
11 !
12 cd - >/dev/null
13 export MMHP="$profile"
14
15 cat >"$draft" <<!
16 From: Bob <bob@example.org>
17 To: alice
18 Date: Sun, 25 Oct 2015 18:59:56 +0100
19 Subject: Test MIME
20 ----------------
21 foo
22 !
23
24 runandcheck 'send -debug "$draft" | sed "/^Content-ID/s/:.*/: <TESTID>/"' <<!
25 From: Bob <bob@example.org>
26 To: alice
27 Date: Sun, 25 Oct 2015 18:59:56 +0100
28 Subject: Test MIME
29 MIME-Version: 1.0
30 Content-Type: text/plain; charset="us-ascii"
31 Content-ID: <TESTID>
32
33 foo
34 ----EOM----
35 alice
36 !
37
38 cat >"$draft" <<!
39 From: Bob <bob@example.org>
40 To: alice
41 Date: Sun, 25 Oct 2015 18:59:56 +0100
42 Subject: Test MIME
43 MIME-Version: 1.0
44 Content-Type: text/plain; charset="us-ascii"
45 Content-ID: <TESTID>
46 ----------------
47 foo
48 !
49
50 runandcheck 'send -debug "$draft"' <<!
51 From: Bob <bob@example.org>
52 To: alice
53 Date: Sun, 25 Oct 2015 18:59:56 +0100
54 Subject: Test MIME
55 MIME-Version: 1.0
56 Content-Type: text/plain; charset="us-ascii"
57 Content-ID: <TESTID>
58
59 foo
60 ----EOM----
61 alice
62 !
63
64
65 cat >"$draft" <<!
66 To: meillo
67 Cc:
68 Subject: mime test 1
69 Date: Fri, 05 Aug 2016 21:38:40 +0200
70 --------
71 foo
72 !
73 runandcheck 'send -debug "$draft" | sed "/^Content-ID/s/:.*/: <TESTID>/"' <<!
74 To: meillo
75 Subject: mime test 1
76 Date: Fri, 05 Aug 2016 21:38:40 +0200
77 MIME-Version: 1.0
78 Content-Type: text/plain; charset="us-ascii"
79 Content-ID: <TESTID>
80 From: Bob <bob@example.org>
81
82 foo
83 ----EOM----
84 meillo
85 !
86
87 cat >"$draft" <<!
88 To: meillo
89 Cc:
90 Subject: mime test 2
91 Date: Fri, 05 Aug 2016 21:38:56 +0200
92 --------
93 foo
94 füße
95 !
96 runandcheck 'send -debug "$draft" | sed "/^Content-ID/s/:.*/: <TESTID>/"' <<!
97 To: meillo
98 Subject: mime test 2
99 Date: Fri, 05 Aug 2016 21:38:56 +0200
100 MIME-Version: 1.0
101 Content-Type: text/plain; charset="UTF-8"
102 Content-ID: <TESTID>
103 Content-Transfer-Encoding: quoted-printable
104 From: Bob <bob@example.org>
105
106 foo
107 f=C3=BC=C3=9Fe
108 ----EOM----
109 meillo
110 !
111
112 cat >"$draft" <<!
113 To: meillo
114 Cc:
115 Subject:mime test 3
116 MIME-Version: 1.0
117 Content-Type: text/plain; charset="us-ascii"
118 Date: Fri, 05 Aug 2016 21:42:16 +0200
119 --------
120 foo
121 !
122 runandcheck 'send -debug "$draft" | sed "/^Content-ID/s/:.*/: <TESTID>/"' <<!
123 To: meillo
124 Subject: mime test 3
125 MIME-Version: 1.0
126 Content-Type: text/plain; charset="us-ascii"
127 Date: Fri, 05 Aug 2016 21:42:16 +0200
128 From: Bob <bob@example.org>
129
130 foo
131 ----EOM----
132 meillo
133 !
134
135 cat >"$draft" <<!
136 To: meillo
137 Cc:
138 Subject:mime test 4
139 MIME-Version: 1.0
140 Content-Type: text/html; charset="us-ascii"
141 Date: Fri, 05 Aug 2016 21:43:06 +0200
142 --------
143 <b>füße</b>
144 !
145 runandcheck 'send -debug "$draft"' <<!
146 To: meillo
147 Subject: mime test 4
148 MIME-Version: 1.0
149 Content-Type: text/html; charset="us-ascii"
150 Date: Fri, 05 Aug 2016 21:43:06 +0200
151 From: Bob <bob@example.org>
152
153 <b>füße</b>
154 ----EOM----
155 meillo
156 !
157
158 cat >"$draft" <<!
159 To: meillo
160 Cc:
161 Subject:mime test 5
162 MIME-Version: 1.0
163 Content-Type: text/plain; charset="latin1"
164 Date: Fri, 05 Aug 2016 21:44:00 +0200
165 --------
166 füße
167 !
168 runandcheck 'send -debug "$draft"' <<!
169 To: meillo
170 Subject: mime test 5
171 MIME-Version: 1.0
172 Content-Type: text/plain; charset="latin1"
173 Date: Fri, 05 Aug 2016 21:44:00 +0200
174 From: Bob <bob@example.org>
175
176 füße
177 ----EOM----
178 meillo
179 !
180
181
182 # now something more complex with separate call to mhbuild(1)
183
184 cat >"$draft" <<!
185 To: meillo
186 Cc:
187 Subject: mime test 6
188 Date: Fri, 05 Aug 2016 21:46:20 +0200
189 --------
190 foo
191 #<text/html
192 <b>bar</b>
193 #text/plain tests/send/ulm.txt
194 Käse
195 #begin [Picture of an Amphioctopus marginatus] alternative
196 #image/png tests/send/amphioctopus-marginatus.png
197 Amphioctopus marginatus sitting in its portable home
198 composed of coconut shell pieces.
199 #end
200 end
201 !
202 runandcheck 'mhbuild "$draft"' <<!
203 !
204 runandcheck 'mhlist -v -file "$draft"' <<!
205  msg part  type/subtype              size description                         
206    0       multipart/mixed           2623
207                 boundary="----- =_aaaaaaaaaa0"
208      1     text/plain                   4
209                 charset="us-ascii"
210      2     text/html                   11
211                 charset="us-ascii"
212      3     text/plain                  35
213                 charset="us-ascii"
214      4     text/plain                   6
215                 charset="UTF-8"
216      5     multipart/alternative     1663 Picture of an Amphioctopus marginatu
217                 boundary="----- =_aaaaaaaaaa1"
218      5.1   text/plain                  87
219                 charset="us-ascii"
220      5.2   image/png                  954
221      6     text/plain                   4
222                 charset="us-ascii"
223 !
224 runandcheck 'send -debug "$draft" | sed "/^Content-ID/s/:.*/: <TESTID>/"' <<!
225 To: meillo
226 Subject: mime test 6
227 Date: Fri, 05 Aug 2016 21:46:20 +0200
228 MIME-Version: 1.0
229 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
230 Content-ID: <TESTID>
231 From: Bob <bob@example.org>
232
233 ------- =_aaaaaaaaaa0
234 Content-Type: text/plain; charset="us-ascii"
235 Content-ID: <TESTID>
236
237 foo
238
239 ------- =_aaaaaaaaaa0
240 Content-Type: text/html; charset="us-ascii"
241 Content-ID: <TESTID>
242
243 <b>bar</b>
244
245 ------- =_aaaaaaaaaa0
246 Content-Type: text/plain; charset="us-ascii"
247 Content-ID: <TESTID>
248
249 in ulm und um ulm und um ulm herum
250
251 ------- =_aaaaaaaaaa0
252 Content-Type: text/plain; charset="UTF-8"
253 Content-ID: <TESTID>
254 Content-Transfer-Encoding: quoted-printable
255
256 K=C3=A4se
257
258 ------- =_aaaaaaaaaa0
259 Content-Type: multipart/alternative; boundary="----- =_aaaaaaaaaa1"
260 Content-ID: <TESTID>
261 Content-Description: Picture of an Amphioctopus marginatus
262
263 ------- =_aaaaaaaaaa1
264 Content-Type: image/png
265 Content-ID: <TESTID>
266 Content-Transfer-Encoding: base64
267
268 iVBORw0KGgoAAAANSUhEUgAAADIAAAArBAMAAADIyMbRAAAABGdBTUEAALGPC/xhBQAAAAFzUkdC
269 AK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAADBQTFRF
270 NSswLygsMycvCwcEKBwThW21iHWuSDhEnZG1b1icUjWPkXXINCBcrp7PzsPhjXtoqrnPvAAAAAx0
271 Uk5TAS5a/flp/tv9/vz8kbJyBAAAAAlwSFlzAAALiQAAC4kBN8nLrQAAAAl2cEFnAAAAlgAAACsA
272 qJ21PgAAAlhJREFUOMu9kz9o20AUxpU60NXQNYOHlkDI4OaudOkQcpeKemlwIVDqoUtVqa0hg8F1
273 KXQL50FOl4ieFAgUHJCsOeAcyZAQaEzGYmSM1NWlWGMcQ+F6lhw7drO2b9Cf99N337v3TpL0z2Im
274 dUMyIUkpafX1DWhpZU4vGvnvfwEM5L2gy1WyMQ0w/v3ND7kevJwywahUzpg+53xjWvLQKB9/tDjv
275 f56UyPiJelDNNXa5PymBRbRuNd13DdrfngCzGEObqjtuQyVrUnKyMGzu6fVzJ0+ys9kxSggg21ab
276 OXbe67dfrQ3QTFpcbuG7OGNQxlQShEHo/byYTd7mkT9CMGPX/bavd8NOZcvQva/vtyKCIfpgsKOw
277 o+thePlDVT3NL0Q2BQRzFmPBJiFhxyNEI5wvx6Uh6FhvLV9RBSL+pvqF91DcMwBr+6zGtItLQipB
278 k/IeXo72CRE8q2s2o4qqV7rem6ogqUgDAFxkpmOZiii70irt9jBOx0MTGstxapqhEt/LzfeKeCVq
279 AcJg3lDMhiCEHTbxpyKObMR+ALinsabF6lRhQetprzBcTBK1PWjlw5CVbUqPSK8oYzwcghA9t4Lw
280 l2KbxuGucBHfxr0GCDy282HXpyZVqnJhQMBwCmhpnTK/rR1Qc1ssJkCMIERyyab7dcehTlZIwBVJ
281 QDG7F6bjnJ/abhbHkpgAgNHqgttwwZn77LpElDDo6vHiCWi4J2AEpCXxAON3sOCeRvf0VQ9GMWdW
282 RwpJugbAI6c6yguftEglktExA+c76ftjkhD/2/D43UmMFf8r/gD+qh1F0ZufSgAAACV0RVh0ZGF0
283 ZTpjcmVhdGUAMjAxNi0wOC0xMFQxODo0MTo1NyswMjowMDnWAU8AAAAldEVYdGRhdGU6bW9kaWZ5
284 ADIwMTYtMDgtMTBUMTg6NDE6NTcrMDI6MDBIi7nzAAAAAElFTkSuQmCC
285
286 ------- =_aaaaaaaaaa1
287 Content-Type: text/plain; charset="us-ascii"
288 Content-ID: <TESTID>
289
290 Amphioctopus marginatus sitting in its portable home
291 composed of coconut shell pieces.
292
293 ------- =_aaaaaaaaaa1--
294
295 ------- =_aaaaaaaaaa0
296 Content-Type: text/plain; charset="us-ascii"
297 Content-ID: <TESTID>
298
299 end
300
301 ------- =_aaaaaaaaaa0--
302 ----EOM----
303 meillo
304 !
305
306 rm "$draft.orig"