From: David Levine Date: Tue, 6 Jan 2015 01:10:33 +0000 (-0600) Subject: Fixed convertarg handling of text part in multipart/related. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/d7a9b5aa35f81e680a54a2f7c2b7dab749812cef Fixed convertarg handling of text part in multipart/related. --- diff --git a/test/repl/test-convert b/test/repl/test-convert index a651957a..000f46fd 100755 --- a/test/repl/test-convert +++ b/test/repl/test-convert @@ -120,4 +120,46 @@ mhbuild "$actual" check "$actual" "$expected" +# check message with text part in multipart/related +cat >"$expected" <<'EOF' +From: recipient@example.com +To: sender@example.com +cc: +Fcc: +outbox +Subject: Re: test with text part in multipart/related +Comments: In-reply-to sender@example.com + message dated "." +MIME-Version: 1.0 +Content-Type: text/plain; charset="UTF-8" +Content-Transfer-Encoding: 8bit + +sender@example.com writes: + +EOF + +cat >`mhpath new` <<'EOF' +From: sender@example.com +To: recipient@example.com +Subject: test with text part in multipart/related +Content-Type: multipart/alternative; boundary="_001_" +MIME-Version: 1.0 + +--_001_ +Content-Type: multipart/related; type="text/plain"; boundary="_002_" + +--_002_ +Content-Type: text/plain + + + +--_002_-- + +--_001_-- +EOF + +repl -filter mhl.replywithoutbody -convertarg text/plain '' -nowhatnowproc last +mhbuild "$actual" +check "$actual" "$expected" + + exit $failed diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index 7984b7d3..850ec8f8 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -2293,8 +2293,8 @@ expand_pseudoheader (CT ct, CT *text_plain_ct, struct multipart *m, /* Concatenate text/plain parts. */ if (reply_ct->c_type == CT_TEXT && reply_ct->c_subtype == TEXT_PLAIN) { - - if (m->mp_parts && ! *text_plain_ct) { + if (! *text_plain_ct && m->mp_parts && m->mp_parts->mp_part && + m->mp_parts->mp_part->c_type == CT_TEXT) { *text_plain_ct = m->mp_parts->mp_part; /* Make sure that the charset is set in the text/plain part. */