fix dist
[mmh] / test / tests / dist / test-dist
diff --git a/test/tests/dist/test-dist b/test/tests/dist/test-dist
new file mode 100755 (executable)
index 0000000..ced6595
--- /dev/null
@@ -0,0 +1,41 @@
+# Test dist
+
+. "$MH_TEST_COMMON"
+
+msgfile=`mhpath b +inbox`
+cat >"$msgfile" <<EOF
+From: juergen <juergen@example.net>
+To: bob@example.com
+Subject: test dist
+Date: Mon, 18 Apr 2016 08:36:14 +0200
+MIME-Version: 1.0
+Content-Type: text/plain; charset="us-ascii"
+Message-ID: <1as2n8-1Q9-00@deseo.home.schnalke.org>
+
+foo
+EOF
+
+runandcheck 'dist -whatnow true l +inbox' <<!
+!
+
+export mhdist=1
+export mhaltmsg=$msgfile
+
+echo 'Resent-To: test@example.com' > `mhpath +drafts l`
+
+runandcheck 'send -debug +drafts l |sed "s/^Resent-Date:.*/Resent-Date:/" |sed "s/^Resent-From:.*/Resent-From:/"' <<!
+From: juergen <juergen@example.net>
+To: bob@example.com
+Subject: test dist
+Date: Mon, 18 Apr 2016 08:36:14 +0200
+MIME-Version: 1.0
+Content-Type: text/plain; charset="us-ascii"
+Message-ID: <1as2n8-1Q9-00@deseo.home.schnalke.org>
+Resent-To: test@example.com
+Resent-Date:
+Resent-From:
+
+foo
+----EOM----
+test@example.com
+!