From: David Levine Date: Sat, 27 Feb 2016 16:33:39 +0000 (-0500) Subject: Added application/ics to default list if types to decode. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/c0a23a5450191c9c67b8ab7ce7b0aea382fa6da6?hp=9bf7ee02e0a01c44e91011d44f4134db7e72487e Added application/ics to default list if types to decode. --- diff --git a/man/mhfixmsg.man b/man/mhfixmsg.man index dd97fe8a..72522777 100644 --- a/man/mhfixmsg.man +++ b/man/mhfixmsg.man @@ -1,4 +1,4 @@ -.TH MHFIXMSG %manext1% "February 24, 2016" "%nmhversion%" +.TH MHFIXMSG %manext1% "February 27, 2016" "%nmhversion%" .\" .\" %nmhwarning% .\" @@ -420,7 +420,7 @@ is checked. .RB ` +folder "' defaults to the current folder" .RB ` msgs "' defaults to cur" .RB ` "\-decodetext 8bit"' -.RB ` "\-decodetypes text"' +.RB ` "\-decodetypes text,application/ics"' .RB ` \-crlflinebreaks ' .RB ` \-notextcharset ' .RB ` \-reformat ' diff --git a/test/mhfixmsg/test-mhfixmsg b/test/mhfixmsg/test-mhfixmsg index 77de37da..5ea79ada 100755 --- a/test/mhfixmsg/test-mhfixmsg +++ b/test/mhfixmsg/test-mhfixmsg @@ -1346,13 +1346,13 @@ Content-Transfer-Encoding: 8bit This is the text/plain part. ------- =_aaaaaaaaaa0 -Content-Type: text/plain; charset="iso-8859-1"; name="test2.txt" +Content-Type: text/html; charset="iso-8859-1"; name="test2.txt" Content-Disposition: attachment; filename="test2.txt" Content-Transfer-Encoding: 8bit - This is the text/html part. + This was the text/html part. @@ -1376,16 +1376,16 @@ Content-Transfer-Encoding: quoted-printable This is the text/plain part. ------- =_aaaaaaaaaa0 -Content-Type: text/plain; charset="iso-8859-1"; name="test2.txt" +Content-Type: text/html; charset="iso-8859-1"; name="test2.txt" Content-Disposition: attachment; filename="test2.txt" Content-Transfer-Encoding: base64 -PGh0bWw+CjxoZWFkPgogICAgVGhpcyBpcyB0aGUgdGV4dC9odG1sIHBhcnQuCjwvaGVhZD4KPC9i -b2R5Pgo8L2h0bWw+Cg== +PGh0bWw+CjxoZWFkPgogICAgVGhpcyB3YXMgdGhlIHRleHQvaHRtbCBwYXJ0Lgo8L2hlYWQ+Cjwv +Ym9keT4KPC9odG1sPgo= ------- =_aaaaaaaaaa0-- EOF -run_prog mhfixmsg last -outfile "$actual" +run_prog mhfixmsg last -outfile "$actual" -noreformat check "$expected" "$actual" @@ -1406,15 +1406,32 @@ Content-Transfer-Encoding: 8bit This is the text/plain part. ------- =_aaaaaaaaaa0 -Content-Type: multipart/alternative; boundary="----=_nmh-multipart2" +Content-Type: text/html; charset="iso-8859-1"; name="test2.txt" +Content-Disposition: attachment; filename="test2.txt" +Content-Transfer-Encoding: base64 -------=_nmh-multipart2 -Content-Type: text/plain; charset="iso-8859-1"; name="test2.txt" -Content-Transfer-Encoding: 8bit +PGh0bWw+DQo8aGVhZD4NCiAgICBUaGlzIGlzIHRoZSB0ZXh0L2h0bWwgcGFydC4NCjwvaGVhZD4N +CjwvYm9keT4NCjwvaHRtbD4NCg== + +------- =_aaaaaaaaaa0-- +EOF + +cat >`mhpath new` <$expected <`mhpath new` <c_type) { - case CT_TEXT: { - struct text *const text_content_info = (struct text *) ct->c_ctparams; + case CT_MULTIPART: { + struct multipart *m = (struct multipart *) ct->c_ctparams; + struct part *part; + + /* Should check to see if the body for this part is encoded? + For now, it gets passed along as-is by InitMultiPart(). */ + for (part = m->mp_parts; status == OK && part; part = part->mp_next) { + status = decode_text_parts (part->mp_part, encoding, decodetypes, message_mods); + } + break; + } + case CT_MESSAGE: + if (ct->c_subtype == MESSAGE_EXTERNAL) { + struct exbody *e = (struct exbody *) ct->c_ctparams; + + status = decode_text_parts (e->eb_content, encoding, decodetypes, message_mods); + } + break; + + default: if (! should_decode(decodetypes, ct->c_ctinfo.ci_type, ct->c_ctinfo.ci_subtype)) { break; } + lf_line_endings = + ct->c_type == CT_TEXT && ct->c_ctparams && + ((struct text *) ct->c_ctparams)->lf_line_endings; + switch (ct->c_encoding) { case CE_BASE64: case CE_QUOTED: { @@ -1852,7 +1875,7 @@ decode_text_parts (CT ct, int encoding, const char *decodetypes, int *message_mo report (NULL, ct->c_partno, ct->c_file, "decode%s", ct->c_ctline ? ct->c_ctline : ""); } - if (text_content_info && text_content_info->lf_line_endings) { + if (lf_line_endings) { strip_crs (ct, message_mods); } } else { @@ -1866,7 +1889,7 @@ decode_text_parts (CT ct, int encoding, const char *decodetypes, int *message_mo } case CE_8BIT: case CE_7BIT: - if (text_content_info && text_content_info->lf_line_endings) { + if (lf_line_endings) { strip_crs (ct, message_mods); } break; @@ -1877,30 +1900,6 @@ decode_text_parts (CT ct, int encoding, const char *decodetypes, int *message_mo break; } - case CT_MULTIPART: { - struct multipart *m = (struct multipart *) ct->c_ctparams; - struct part *part; - - /* Should check to see if the body for this part is encoded? - For now, it gets passed along as-is by InitMultiPart(). */ - for (part = m->mp_parts; status == OK && part; part = part->mp_next) { - status = decode_text_parts (part->mp_part, encoding, decodetypes, message_mods); - } - break; - } - - case CT_MESSAGE: - if (ct->c_subtype == MESSAGE_EXTERNAL) { - struct exbody *e = (struct exbody *) ct->c_ctparams; - - status = decode_text_parts (e->eb_content, encoding, decodetypes, message_mods); - } - break; - - default: - break; - } - return status; }