Bug 1576828 - Remove pref mailnews.p7m_subparts_external and related code/tests. r=mkmelin DONTBUILD
authorKai Engert <kaie>
Fri, 18 Oct 2019 11:43:06 +0200
changeset 37178 29569cac6cec51c2b42c13707ee48a4718980efe
parent 37177 e2e9a71dc663501ae30b40c308f4ef006a844960
child 37179 5d026b6b005ea8d5bd5e09c1286adce59e9cc6c2
push id395
push userclokep@gmail.com
push dateMon, 02 Dec 2019 19:38:57 +0000
reviewersmkmelin
bugs1576828
Bug 1576828 - Remove pref mailnews.p7m_subparts_external and related code/tests. r=mkmelin DONTBUILD
mailnews/mailnews.js
mailnews/mime/src/mimei.cpp
mailnews/mime/test/unit/test_alternate_p7m_handling.js
--- a/mailnews/mailnews.js
+++ b/mailnews/mailnews.js
@@ -158,17 +158,16 @@ pref("mail.strictly_mime_headers",      
 pref("mail.folder_widget.max_recent",       25); // The maximum number of entries in the "Recent" menu of the folder picker.
 // 0/1 (name param is encoded in a legacy way), 2(RFC 2231 only)
 // 0 the name param is never separated to multiple lines.
 pref("mail.strictly_mime.parm_folding",     1);
 pref("mail.label_ascii_only_mail_as_us_ascii", false);
 pref("mail.file_attach_binary",             false);
 pref("mail.show_headers",                   1); // some
 pref("mailnews.p7m_external", false);          // S/MIME parts are not external (but inline decrypted).
-pref("mailnews.p7m_subparts_external", true);  // S/MIME child parts are external. Protect against efail.
 pref("mail.pane_config.dynamic",            0);
 pref("mail.addr_book.mapit_url.format", "chrome://messenger-region/locale/region.properties");
 pref("mail.addr_book.mapit_url.1.name", "chrome://messenger-region/locale/region.properties");
 pref("mail.addr_book.mapit_url.1.format", "chrome://messenger-region/locale/region.properties");
 pref("mail.addr_book.mapit_url.2.name", "chrome://messenger-region/locale/region.properties");
 pref("mail.addr_book.mapit_url.2.format", "chrome://messenger-region/locale/region.properties");
 pref("mail.addr_book.mapit_url.3.name", "chrome://messenger-region/locale/region.properties");
 pref("mail.addr_book.mapit_url.3.format", "chrome://messenger-region/locale/region.properties");
--- a/mailnews/mime/src/mimei.cpp
+++ b/mailnews/mime/src/mimei.cpp
@@ -661,18 +661,17 @@ MimeObjectClass *mime_find_class(const c
         clazz = (MimeObjectClass *)&mimeInlineImageClass;
       else
         clazz = (MimeObjectClass *)&mimeExternalObjectClass;
     }
 #ifdef ENABLE_SMIME
     else if (!PL_strcasecmp(content_type, APPLICATION_XPKCS7_MIME) ||
              !PL_strcasecmp(content_type, APPLICATION_PKCS7_MIME)) {
 
-      if (Preferences::GetBool("mailnews.p7m_subparts_external", true) &&
-          opts->is_child) {
+      if (opts->is_child) {
         // We do not allow encrypted parts except as top level.
         // Allowing them would leak the plain text in case the part is
         // cleverly hidden and the decrypted content gets included in
         // replies and forwards.
         clazz = (MimeObjectClass *)&mimeSuppressedCryptoClass;
       } else {
         char *ct =
             hdrs ? MimeHeaders_get(hdrs, HEADER_CONTENT_TYPE, false, false)
--- a/mailnews/mime/test/unit/test_alternate_p7m_handling.js
+++ b/mailnews/mime/test/unit/test_alternate_p7m_handling.js
@@ -35,20 +35,16 @@ var messages = {
 function* worker(params) {
   let synMsg = gMessageGenerator.makeMessage(params.messages);
   let synSet = new SyntheticMessageSet([synMsg]);
   yield add_sets_to_folder(gInbox, [synSet]);
 
   let msgHdr = synSet.getMsgHdr(0);
 
   Services.prefs.setBoolPref("mailnews.p7m_external", params.all_external);
-  Services.prefs.setBoolPref(
-    "mailnews.p7m_subparts_external",
-    params.subparts_external
-  );
 
   MsgHdrToMimeMessage(msgHdr, null, function(aMsgHdr, aMimeMsg) {
     try {
       Assert.ok(aMimeMsg.allUserAttachments.length == params.count);
       async_driver();
     } catch (err) {
       do_throw(err);
     }
@@ -56,28 +52,20 @@ function* worker(params) {
 
   yield false;
 }
 
 /* ===== Driver ===== */
 
 var tests = [
   parameterizeTest(worker, [
-    { messages, all_external: false, subparts_external: false, count: 0 },
-  ]),
-  // We are only testing with a p7m attachment, so whether all parts or just subparts are
-  // made external yields the same result: one attachment which is not inlined.
-  parameterizeTest(worker, [
-    { messages, all_external: true, subparts_external: false, count: 1 },
+    { messages, all_external: false, count: 1 },
   ]),
   parameterizeTest(worker, [
-    { messages, all_external: false, subparts_external: true, count: 1 },
-  ]),
-  parameterizeTest(worker, [
-    { messages, all_external: true, subparts_external: true, count: 1 },
+    { messages, all_external: true, count: 1 },
   ]),
 ];
 
 var gInbox;
 
 function run_test() {
   gInbox = configure_message_injection({ mode: "local" });
   async_run_tests(tests);