--- /dev/null
+# 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
+!
int length = strlen(attach_hdr);
char *p;
+ if(distfile) {
+ return DONE;
+ }
+
if (!(draft_file = fopen(draft_file_name, "r"))) {
adios(EX_IOERR, NULL, "can't open draft file `%s'.", draft_file_name);
}
int doenc = 0;
int ret;
+ if(distfile) {
+ return DONE;
+ }
+
if (!(draft_file = fopen(draft_file_name, "r"))) {
adios(EX_IOERR, NULL, "can't open draft file `%s'.", draft_file_name);
}