Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Jul 2018 19:47:21 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org
Subject:   svn commit: r474298 - in branches/2018Q3: mail/thunderbird mail/thunderbird/files www/seamonkey www/seamonkey/files
Message-ID:  <201807091947.w69JlLY5020071@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Mon Jul  9 19:47:20 2018
New Revision: 474298
URL: https://svnweb.freebsd.org/changeset/ports/474298

Log:
  MFH: r474292
  
  mail/thunderbird: prevent mail corruption after r473670
  
  PR:		229452
  Obtained from:	upstream (Thunderbird 52.9.1)
  Approved by:	ports-secteam blanket

Added:
  branches/2018Q3/mail/thunderbird/files/patch-bug1473893
     - copied unchanged from r474292, head/mail/thunderbird/files/patch-bug1473893
  branches/2018Q3/www/seamonkey/files/patch-bug1473893
     - copied unchanged from r474292, head/www/seamonkey/files/patch-bug1473893
Modified:
  branches/2018Q3/mail/thunderbird/Makefile
  branches/2018Q3/www/seamonkey/Makefile
Directory Properties:
  branches/2018Q3/   (props changed)

Modified: branches/2018Q3/mail/thunderbird/Makefile
==============================================================================
--- branches/2018Q3/mail/thunderbird/Makefile	Mon Jul  9 19:42:38 2018	(r474297)
+++ branches/2018Q3/mail/thunderbird/Makefile	Mon Jul  9 19:47:20 2018	(r474298)
@@ -3,6 +3,7 @@
 
 PORTNAME=	thunderbird
 DISTVERSION=	52.9.0
+PORTREVISION=	1
 CATEGORIES=	mail news net-im ipv6
 MASTER_SITES=	MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \
 		MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build2/source

Copied: branches/2018Q3/mail/thunderbird/files/patch-bug1473893 (from r474292, head/mail/thunderbird/files/patch-bug1473893)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2018Q3/mail/thunderbird/files/patch-bug1473893	Mon Jul  9 19:47:20 2018	(r474298, copy of r474292, head/mail/thunderbird/files/patch-bug1473893)
@@ -0,0 +1,73 @@
+commit f883eeb39f24
+Author: Jorg K <jorgk@jorgk.com>
+Date:   Mon Jul 9 00:09:58 2018 +0200
+
+    Bug 1473893 - Don't use parsed HTML MIME class if saving, processing attachments and in other cases. r=aceman a=jorgk
+
+---
+ mailnews/db/gloda/test/unit/test_mime_attachments_size.js |  3 ---
+ mailnews/mime/src/mimei.cpp                               | 12 ++++++++++--
+ 2 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git mailnews/db/gloda/test/unit/test_mime_attachments_size.js mailnews/db/gloda/test/unit/test_mime_attachments_size.js
+index 7eff626979..389bebee42 100644
+--- mailnews/db/gloda/test/unit/test_mime_attachments_size.js
++++ mailnews/db/gloda/test/unit/test_mime_attachments_size.js
+@@ -211,19 +211,16 @@ function check_attachments(aMimeMsg, eps
+   for (let att of aMimeMsg.allUserAttachments) {
+     dump("*** Attachment now is " + att.name + " " + att.size + "\n");
+     do_check_true(Math.abs(att.size - originalTextByteCount) <= epsilon);
+     totalSize += att.size;
+   }
+ 
+   // undefined means true
+   if (checkTotalSize !== false) {
+-    // Account for stuff added by libmime, incl. two CRLF or LF before and after.
+-    totalSize += "<meta http-equiv=\"content-type\" content=\"text\/html; \">".length;
+-    totalSize += ("@mozilla.org/windows-registry-key;1" in Cc) ? 4 : 2;
+     dump("*** Total size comparison: " + totalSize + " vs " + aMimeMsg.size + "\n");
+     do_check_true(Math.abs(aMimeMsg.size - totalSize) <= epsilon);
+   }
+ 
+   async_driver();
+ }
+ 
+ function* test_message_attachments(info) {
+diff --git mailnews/mime/src/mimei.cpp mailnews/mime/src/mimei.cpp
+index 450eae584a..8290a83e63 100644
+--- mailnews/mime/src/mimei.cpp
++++ mailnews/mime/src/mimei.cpp
+@@ -505,21 +505,29 @@ mime_find_class (const char *content_typ
+       clazz = (MimeObjectClass *)&mimeUntypedTextClass;
+ 
+     /* Subtypes of text...
+     */
+     else if (!PL_strncasecmp(content_type,      "text/", 5))
+     {
+       if      (!PL_strcasecmp(content_type+5,    "html"))
+       {
+-        if (opts
+-            && opts->format_out == nsMimeOutput::nsMimeMessageSaveAs)
++        if (opts &&
++            (opts->format_out == nsMimeOutput::nsMimeMessageSaveAs ||
++             opts->format_out == nsMimeOutput::nsMimeMessageFilterSniffer ||
++             opts->format_out == nsMimeOutput::nsMimeMessageDecrypt ||
++             opts->format_out == nsMimeOutput::nsMimeMessageAttach))
+           // SaveAs in new modes doesn't work yet.
+         {
+-          clazz = (MimeObjectClass *)&mimeInlineTextHTMLParsedClass;
++          // Don't use the parsed HTML class if we're ...
++          // - saving the HTML of a message
++          // - getting message content for filtering
++          // - snarfing attachments (nsMimeMessageDecrypt used in SnarfMsgAttachment)
++          // - processing attachments (like deleting attachments).
++          clazz = (MimeObjectClass *)&mimeInlineTextHTMLClass;
+           types_of_classes_to_disallow = 0;
+         }
+         else if (html_as == 0 || html_as == 4) // Render sender's HTML
+           clazz = (MimeObjectClass *)&mimeInlineTextHTMLParsedClass;
+         else if (html_as == 1) // convert HTML to plaintext
+           // Do a HTML->TXT->HTML conversion, see mimethpl.h.
+           clazz = (MimeObjectClass *)&mimeInlineTextHTMLAsPlaintextClass;
+         else if (html_as == 2) // display HTML source
+

Modified: branches/2018Q3/www/seamonkey/Makefile
==============================================================================
--- branches/2018Q3/www/seamonkey/Makefile	Mon Jul  9 19:42:38 2018	(r474297)
+++ branches/2018Q3/www/seamonkey/Makefile	Mon Jul  9 19:47:20 2018	(r474298)
@@ -3,7 +3,7 @@
 
 PORTNAME=	seamonkey
 DISTVERSION=	2.49.4
-PORTREVISION=	9
+PORTREVISION=	10
 MOZILLA_VER=	52 # above + 3
 CATEGORIES?=	www mail news editors irc ipv6
 MASTER_SITES=	MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \

Copied: branches/2018Q3/www/seamonkey/files/patch-bug1473893 (from r474292, head/www/seamonkey/files/patch-bug1473893)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2018Q3/www/seamonkey/files/patch-bug1473893	Mon Jul  9 19:47:20 2018	(r474298, copy of r474292, head/www/seamonkey/files/patch-bug1473893)
@@ -0,0 +1,73 @@
+commit f883eeb39f24
+Author: Jorg K <jorgk@jorgk.com>
+Date:   Mon Jul 9 00:09:58 2018 +0200
+
+    Bug 1473893 - Don't use parsed HTML MIME class if saving, processing attachments and in other cases. r=aceman a=jorgk
+
+---
+ mailnews/db/gloda/test/unit/test_mime_attachments_size.js |  3 ---
+ mailnews/mime/src/mimei.cpp                               | 12 ++++++++++--
+ 2 files changed, 10 insertions(+), 5 deletions(-)
+
+diff --git mailnews/db/gloda/test/unit/test_mime_attachments_size.js mailnews/db/gloda/test/unit/test_mime_attachments_size.js
+index 7eff626979..389bebee42 100644
+--- mailnews/db/gloda/test/unit/test_mime_attachments_size.js
++++ mailnews/db/gloda/test/unit/test_mime_attachments_size.js
+@@ -211,19 +211,16 @@ function check_attachments(aMimeMsg, eps
+   for (let att of aMimeMsg.allUserAttachments) {
+     dump("*** Attachment now is " + att.name + " " + att.size + "\n");
+     do_check_true(Math.abs(att.size - originalTextByteCount) <= epsilon);
+     totalSize += att.size;
+   }
+ 
+   // undefined means true
+   if (checkTotalSize !== false) {
+-    // Account for stuff added by libmime, incl. two CRLF or LF before and after.
+-    totalSize += "<meta http-equiv=\"content-type\" content=\"text\/html; \">".length;
+-    totalSize += ("@mozilla.org/windows-registry-key;1" in Cc) ? 4 : 2;
+     dump("*** Total size comparison: " + totalSize + " vs " + aMimeMsg.size + "\n");
+     do_check_true(Math.abs(aMimeMsg.size - totalSize) <= epsilon);
+   }
+ 
+   async_driver();
+ }
+ 
+ function* test_message_attachments(info) {
+diff --git mailnews/mime/src/mimei.cpp mailnews/mime/src/mimei.cpp
+index 450eae584a..8290a83e63 100644
+--- mailnews/mime/src/mimei.cpp
++++ mailnews/mime/src/mimei.cpp
+@@ -505,21 +505,29 @@ mime_find_class (const char *content_typ
+       clazz = (MimeObjectClass *)&mimeUntypedTextClass;
+ 
+     /* Subtypes of text...
+     */
+     else if (!PL_strncasecmp(content_type,      "text/", 5))
+     {
+       if      (!PL_strcasecmp(content_type+5,    "html"))
+       {
+-        if (opts
+-            && opts->format_out == nsMimeOutput::nsMimeMessageSaveAs)
++        if (opts &&
++            (opts->format_out == nsMimeOutput::nsMimeMessageSaveAs ||
++             opts->format_out == nsMimeOutput::nsMimeMessageFilterSniffer ||
++             opts->format_out == nsMimeOutput::nsMimeMessageDecrypt ||
++             opts->format_out == nsMimeOutput::nsMimeMessageAttach))
+           // SaveAs in new modes doesn't work yet.
+         {
+-          clazz = (MimeObjectClass *)&mimeInlineTextHTMLParsedClass;
++          // Don't use the parsed HTML class if we're ...
++          // - saving the HTML of a message
++          // - getting message content for filtering
++          // - snarfing attachments (nsMimeMessageDecrypt used in SnarfMsgAttachment)
++          // - processing attachments (like deleting attachments).
++          clazz = (MimeObjectClass *)&mimeInlineTextHTMLClass;
+           types_of_classes_to_disallow = 0;
+         }
+         else if (html_as == 0 || html_as == 4) // Render sender's HTML
+           clazz = (MimeObjectClass *)&mimeInlineTextHTMLParsedClass;
+         else if (html_as == 1) // convert HTML to plaintext
+           // Do a HTML->TXT->HTML conversion, see mimethpl.h.
+           clazz = (MimeObjectClass *)&mimeInlineTextHTMLAsPlaintextClass;
+         else if (html_as == 2) // display HTML source
+



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807091947.w69JlLY5020071>