diff --git a/sources/testing/samples/messages/zpush-html-preview-bug.txt b/sources/testing/samples/messages/zpush-html-preview-bug.txt new file mode 100644 index 0000000..ad3e4e9 --- /dev/null +++ b/sources/testing/samples/messages/zpush-html-preview-bug.txt @@ -0,0 +1,66 @@ +Envelope-to: TOUSER@DOMAIN.COM +Delivery-date: Wed, 04 Nov 2015 18:55:14 -0500 +From: "FROMUSER" +To: "TOUSER" +Subject: Jane's back +Date: Wed, 4 Nov 2015 17:54:35 -0600 +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_NextPart_000_05F0_01D11729.DDC49140" +X-Priority: 3 +X-MSMail-Priority: Normal +Importance: Normal +X-Mailer: Microsoft Windows Live Mail 15.4.3508.1109 +X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3508.1109 + +This is a multi-part message in MIME format. + +------=_NextPart_000_05F0_01D11729.DDC49140 +Content-Type: text/plain; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + +How is she doing? + +Dad + +--- +This email has been checked for viruses by Avast antivirus software. +https://www.avast.com/antivirus + +------=_NextPart_000_05F0_01D11729.DDC49140 +Content-Type: text/html; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + + + +
+
+
How is she doing?
+
 
+
Dad
+

+
+ + + + + +
+ + 3D"Avast + + +

+ This email has been checked for viruses by Avast antivirus software. +
www.avast.com +

+
+
+ + +------=_NextPart_000_05F0_01D11729.DDC49140-- diff --git a/sources/testing/testing-mime_preview.php b/sources/testing/testing-mime_preview.php new file mode 100644 index 0000000..a65d3a2 --- /dev/null +++ b/sources/testing/testing-mime_preview.php @@ -0,0 +1,24 @@ +decode(array('decode_headers' => true, 'decode_bodies' => true, 'include_bodies' => true, 'rfc_822bodies' => true, 'charset' => 'utf-8')); +unset($mobj); + +$previewText = ""; +Mail_mimeDecode::getBodyRecursive($message, "plain", $previewText, true); +if (strlen($previewText) == 0) { + printf("No Plain part found\n"); + Mail_mimeDecode::getBodyRecursive($message, "html", $previewText, true); + $previewText = Utils::ConvertHtmlToText($previewText); +} +printf("%s\n", Utils::Utf8_truncate($previewText, 250)); \ No newline at end of file