From 1776330d10566166731f7938d28a7bf057381a53 Mon Sep 17 00:00:00 2001 From: Paul Fox Date: Wed, 7 May 2014 19:43:04 -0400 Subject: [PATCH] add new test for NUL bytes embedded in text/plain parts such parts should be encoded with quoted-printable --- test/mhbuild/somebinary | Bin 0 -> 74 bytes test/mhbuild/test-attach | 49 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 test/mhbuild/somebinary diff --git a/test/mhbuild/somebinary b/test/mhbuild/somebinary new file mode 100644 index 0000000000000000000000000000000000000000..168b96328dff0056999673b6e395c6c4ab5fac0e GIT binary patch literal 74 zcmd;bE6UGR$Ve?pRmjiNQ7FmCELH%b{Jfk>1+GMelGNf7kZ68sdWJ$~i9&LIUP)qR YUa^93er_rkLw-sMgF;dzP?a7R0GllsH~;_u literal 0 HcmV?d00001 diff --git a/test/mhbuild/test-attach b/test/mhbuild/test-attach index 97667920..f356e491 100755 --- a/test/mhbuild/test-attach +++ b/test/mhbuild/test-attach @@ -280,6 +280,55 @@ EOF check "$draft" "$expected" +# +# One attachment, text/plain containing some binary characters, +# include NUL bytes. +# + +cat > "$draft" < +cc: +Fcc: +outbox +Subject: Testing some binary chars +-------- +This is some tëxt. +#text/plain; name="somebinary" [ - ] {attachment} ${srcdir}/test/mhbuild/somebinary +EOF + +run_prog mhbuild "$draft" + +cat > "$expected" < +cc: +Fcc: +outbox +Subject: Testing some binary chars +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" +Content-Transfer-Encoding: 8bit + +------- =_aaaaaaaaaa0 +Content-Type: text/plain; charset="UTF-8" +Content-Transfer-Encoding: 8bit + +This is some tëxt. + +------- =_aaaaaaaaaa0 +Content-Type: text/plain; name="somebinary"; charset="us-ascii" +Content-Description: - +Content-Disposition: attachment; filename="somebinary" +Content-Transfer-Encoding: quoted-printable + + +=46rom here on, this is only = + +a test, though it contains =13ome +=00odd=00 bytes. + +------- =_aaaaaaaaaa0-- +EOF + +check "$draft" "$expected" + [ ${failed:=0} -eq 0 ] && rm -f ${backup} exit ${failed:-0} -- 2.56.0