----EOM----
alice
!
+
+
+cat >"$draft" <<!
+To: meillo
+Cc:
+Subject: mime test 1
+Date: Fri, 05 Aug 2016 21:38:40 +0200
+--------
+foo
+!
+runandcheck 'send -debug "$draft" | sed "/^Content-ID/s/:.*/: <TESTID>/"' <<!
+To: meillo
+Subject: mime test 1
+Date: Fri, 05 Aug 2016 21:38:40 +0200
+MIME-Version: 1.0
+Content-Type: text/plain; charset="us-ascii"
+Content-ID: <TESTID>
+From: Bob <bob@example.org>
+
+foo
+----EOM----
+meillo
+!
+
+cat >"$draft" <<!
+To: meillo
+Cc:
+Subject: mime test 2
+Date: Fri, 05 Aug 2016 21:38:56 +0200
+--------
+foo
+füße
+!
+runandcheck 'send -debug "$draft" | sed "/^Content-ID/s/:.*/: <TESTID>/"' <<!
+To: meillo
+Subject: mime test 2
+Date: Fri, 05 Aug 2016 21:38:56 +0200
+MIME-Version: 1.0
+Content-Type: text/plain; charset="UTF-8"
+Content-ID: <TESTID>
+Content-Transfer-Encoding: quoted-printable
+From: Bob <bob@example.org>
+
+foo
+f=C3=BC=C3=9Fe
+----EOM----
+meillo
+!
+
+cat >"$draft" <<!
+To: meillo
+Cc:
+Subject:mime test 3
+MIME-Version: 1.0
+Content-Type: text/plain; charset="us-ascii"
+Date: Fri, 05 Aug 2016 21:42:16 +0200
+--------
+foo
+!
+runandcheck 'send -debug "$draft" | sed "/^Content-ID/s/:.*/: <TESTID>/"' <<!
+To: meillo
+Subject: mime test 3
+MIME-Version: 1.0
+Content-Type: text/plain; charset="us-ascii"
+Date: Fri, 05 Aug 2016 21:42:16 +0200
+From: Bob <bob@example.org>
+
+foo
+----EOM----
+meillo
+!
+
+cat >"$draft" <<!
+To: meillo
+Cc:
+Subject:mime test 4
+MIME-Version: 1.0
+Content-Type: text/html; charset="us-ascii"
+Date: Fri, 05 Aug 2016 21:43:06 +0200
+--------
+<b>füße</b>
+!
+runandcheck 'send -debug "$draft"' <<!
+To: meillo
+Subject: mime test 4
+MIME-Version: 1.0
+Content-Type: text/html; charset="us-ascii"
+Date: Fri, 05 Aug 2016 21:43:06 +0200
+From: Bob <bob@example.org>
+
+<b>füße</b>
+----EOM----
+meillo
+!
+
+cat >"$draft" <<!
+To: meillo
+Cc:
+Subject:mime test 5
+MIME-Version: 1.0
+Content-Type: text/plain; charset="latin1"
+Date: Fri, 05 Aug 2016 21:44:00 +0200
+--------
+füße
+!
+runandcheck 'send -debug "$draft"' <<!
+To: meillo
+Subject: mime test 5
+MIME-Version: 1.0
+Content-Type: text/plain; charset="latin1"
+Date: Fri, 05 Aug 2016 21:44:00 +0200
+From: Bob <bob@example.org>
+
+füße
+----EOM----
+meillo
+!
+
+
+# now something more complex with separate call to mhbuild(1)
+
+cat >"$draft" <<!
+To: meillo
+Cc:
+Subject: mime test 6
+Date: Fri, 05 Aug 2016 21:46:20 +0200
+--------
+foo
+#<text/html
+<b>bar</b>
+#text/plain tests/send/ulm.txt
+Käse
+#begin [Picture of an Amphioctopus marginatus] alternative
+#image/png tests/send/amphioctopus-marginatus.png
+Amphioctopus marginatus sitting in its portable home
+composed of coconut shell pieces.
+#end
+end
+!
+runandcheck 'mhbuild "$draft"' <<!
+!
+runandcheck 'mhlist -v -file "$draft"' <<!
+ msg part type/subtype size description
+ 0 multipart/mixed 2623
+ boundary="----- =_aaaaaaaaaa0"
+ 1 text/plain 4
+ charset="us-ascii"
+ 2 text/html 11
+ charset="us-ascii"
+ 3 text/plain 35
+ charset="us-ascii"
+ 4 text/plain 6
+ charset="UTF-8"
+ 5 multipart/alternative 1663 Picture of an Amphioctopus marginatu
+ boundary="----- =_aaaaaaaaaa1"
+ 5.1 text/plain 87
+ charset="us-ascii"
+ 5.2 image/png 954
+ 6 text/plain 4
+ charset="us-ascii"
+!
+runandcheck 'send -debug "$draft" | sed "/^Content-ID/s/:.*/: <TESTID>/"' <<!
+To: meillo
+Subject: mime test 6
+Date: Fri, 05 Aug 2016 21:46:20 +0200
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
+Content-ID: <TESTID>
+From: Bob <bob@example.org>
+
+------- =_aaaaaaaaaa0
+Content-Type: text/plain; charset="us-ascii"
+Content-ID: <TESTID>
+
+foo
+
+------- =_aaaaaaaaaa0
+Content-Type: text/html; charset="us-ascii"
+Content-ID: <TESTID>
+
+<b>bar</b>
+
+------- =_aaaaaaaaaa0
+Content-Type: text/plain; charset="us-ascii"
+Content-ID: <TESTID>
+
+in ulm und um ulm und um ulm herum
+
+------- =_aaaaaaaaaa0
+Content-Type: text/plain; charset="UTF-8"
+Content-ID: <TESTID>
+Content-Transfer-Encoding: quoted-printable
+
+K=C3=A4se
+
+------- =_aaaaaaaaaa0
+Content-Type: multipart/alternative; boundary="----- =_aaaaaaaaaa1"
+Content-ID: <TESTID>
+Content-Description: Picture of an Amphioctopus marginatus
+
+------- =_aaaaaaaaaa1
+Content-Type: image/png
+Content-ID: <TESTID>
+Content-Transfer-Encoding: base64
+
+iVBORw0KGgoAAAANSUhEUgAAADIAAAArBAMAAADIyMbRAAAABGdBTUEAALGPC/xhBQAAAAFzUkdC
+AK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAADBQTFRF
+NSswLygsMycvCwcEKBwThW21iHWuSDhEnZG1b1icUjWPkXXINCBcrp7PzsPhjXtoqrnPvAAAAAx0
+Uk5TAS5a/flp/tv9/vz8kbJyBAAAAAlwSFlzAAALiQAAC4kBN8nLrQAAAAl2cEFnAAAAlgAAACsA
+qJ21PgAAAlhJREFUOMu9kz9o20AUxpU60NXQNYOHlkDI4OaudOkQcpeKemlwIVDqoUtVqa0hg8F1
+KXQL50FOl4ieFAgUHJCsOeAcyZAQaEzGYmSM1NWlWGMcQ+F6lhw7drO2b9Cf99N337v3TpL0z2Im
+dUMyIUkpafX1DWhpZU4vGvnvfwEM5L2gy1WyMQ0w/v3ND7kevJwywahUzpg+53xjWvLQKB9/tDjv
+f56UyPiJelDNNXa5PymBRbRuNd13DdrfngCzGEObqjtuQyVrUnKyMGzu6fVzJ0+ys9kxSggg21ab
+OXbe67dfrQ3QTFpcbuG7OGNQxlQShEHo/byYTd7mkT9CMGPX/bavd8NOZcvQva/vtyKCIfpgsKOw
+o+thePlDVT3NL0Q2BQRzFmPBJiFhxyNEI5wvx6Uh6FhvLV9RBSL+pvqF91DcMwBr+6zGtItLQipB
+k/IeXo72CRE8q2s2o4qqV7rem6ogqUgDAFxkpmOZiii70irt9jBOx0MTGstxapqhEt/LzfeKeCVq
+AcJg3lDMhiCEHTbxpyKObMR+ALinsabF6lRhQetprzBcTBK1PWjlw5CVbUqPSK8oYzwcghA9t4Lw
+l2KbxuGucBHfxr0GCDy282HXpyZVqnJhQMBwCmhpnTK/rR1Qc1ssJkCMIERyyab7dcehTlZIwBVJ
+QDG7F6bjnJ/abhbHkpgAgNHqgttwwZn77LpElDDo6vHiCWi4J2AEpCXxAON3sOCeRvf0VQ9GMWdW
+RwpJugbAI6c6yguftEglktExA+c76ftjkhD/2/D43UmMFf8r/gD+qh1F0ZufSgAAACV0RVh0ZGF0
+ZTpjcmVhdGUAMjAxNi0wOC0xMFQxODo0MTo1NyswMjowMDnWAU8AAAAldEVYdGRhdGU6bW9kaWZ5
+ADIwMTYtMDgtMTBUMTg6NDE6NTcrMDI6MDBIi7nzAAAAAElFTkSuQmCC
+
+------- =_aaaaaaaaaa1
+Content-Type: text/plain; charset="us-ascii"
+Content-ID: <TESTID>
+
+Amphioctopus marginatus sitting in its portable home
+composed of coconut shell pieces.
+
+------- =_aaaaaaaaaa1--
+
+------- =_aaaaaaaaaa0
+Content-Type: text/plain; charset="us-ascii"
+Content-ID: <TESTID>
+
+end
+
+------- =_aaaaaaaaaa0--
+----EOM----
+meillo
+!
+
+rm "$draft.orig"