From 57251c0435c8b994c85baf68099ac0e60436444a Mon Sep 17 00:00:00 2001 From: Philipp Takacs Date: Thu, 11 Aug 2016 17:22:49 +0200 Subject: [PATCH] fix dist Because of always mimeify the dist hasn't work anymore. This is fixed by skipping attach() and signandenc(), if it's handled as a redistribution message. --- test/tests/dist/test-dist | 41 +++++++++++++++++++++++++++++++++++++++++ uip/send.c | 8 ++++++++ 2 files changed, 49 insertions(+) create mode 100755 test/tests/dist/test-dist diff --git a/test/tests/dist/test-dist b/test/tests/dist/test-dist new file mode 100755 index 0000000..ced6595 --- /dev/null +++ b/test/tests/dist/test-dist @@ -0,0 +1,41 @@ +# Test dist + +. "$MH_TEST_COMMON" + +msgfile=`mhpath b +inbox` +cat >"$msgfile" < +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' < `mhpath +drafts l` + +runandcheck 'send -debug +drafts l |sed "s/^Resent-Date:.*/Resent-Date:/" |sed "s/^Resent-From:.*/Resent-From:/"' < +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 +! diff --git a/uip/send.c b/uip/send.c index 9ad124f..eac15ae 100644 --- a/uip/send.c +++ b/uip/send.c @@ -336,6 +336,10 @@ attach(char *draft_file_name) 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); } @@ -438,6 +442,10 @@ signandenc(char *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); } -- 1.7.10.4