From 2885665e14e1ca0aaac7d9809be4783b92b4d8d9 Mon Sep 17 00:00:00 2001 From: David Levine Date: Thu, 17 Mar 2016 22:05:54 -0400 Subject: [PATCH] Have fix_boundary() return NOTOK if it couldn't fix a boundary, so that mhfixmsg won't modify the message. --- test/mhfixmsg/test-mhfixmsg | 39 +++++++++++++++++++++++++++++++------ uip/mhfixmsg.c | 9 +++++++++ 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/test/mhfixmsg/test-mhfixmsg b/test/mhfixmsg/test-mhfixmsg index 61821c27..cf97d5ff 100755 --- a/test/mhfixmsg/test-mhfixmsg +++ b/test/mhfixmsg/test-mhfixmsg @@ -887,6 +887,33 @@ run_test 'mhfixmsg last -outfile '"$actual"' -verbose' \ check "$expected" "$actual" +# check that message is not modified when -fixboundary fails +cat >`mhpath new` < +To: +Subject: mhfixmsg bad boundary test + +This is a multi-part message in MIME format. + +------=_ NextPart_000_1781A1A_01CC1147.81EBA8D4 +Content-Type: text/plain + +The boundary below doesn't match the header boundary. + +------=_ +NextPart_000_1781A1A_01CC1147.81EBA8D4-- +EOF + +cp -p `mhpath last` "$expected" +run_test "mhfixmsg last -outfile $actual" '' +check "$expected" "$actual" + + # check that text/plain part is not added to text/html in multipart/related # when it shouldn't be cat >`mhpath new` <