display .p7m attachments, bug 243833, r=asuth
authorDavid Bienvenu <bienvenu@nventure.com>
Wed, 04 May 2011 12:12:22 -0700
changeset 7691 8b8f6d0418b2701e7e1b50325233d5984ed99394
parent 7690 d84807ecf69cfd4c9332459bc0a34f5df5aa972f
child 7692 30c37ed6e0bb214bad6e512bb3c7ffa55e40a3d9
push idunknown
push userunknown
push dateunknown
reviewersasuth
bugs243833
display .p7m attachments, bug 243833, r=asuth
mail/test/mozmill/attachment/test-attachment.js
mailnews/mime/src/mimei.cpp
--- a/mail/test/mozmill/attachment/test-attachment.js
+++ b/mail/test/mozmill/attachment/test-attachment.js
@@ -92,16 +92,23 @@ var setupModule = function (module) {
     { attachments: [{ body: textAttachment,
                       filename: 'ubik.txt',
                       format: '' },
                     { body: binaryAttachment,
                       contentType: 'application/octet-stream',
                       filename: 'ubik.xxyyzz',
                       format: '' }],
     },
+    // cert attachment (make sure Mime doesn't swallow this, which
+    // test_attachment_view_expanded does for us.
+    { attachments: [{ body: binaryAttachment,
+                      contentType: 'application/pkcs7-mime',
+                      filename: 'cert.p7m',
+                      format: '' }],
+    },
   ];
 
   for (let i = 0; i < messages.length; i++)
     add_message_to_folder(folder, create_message(messages[i]));
 };
 
 function test_attachment_view_collapsed() {
   be_in_folder(folder);
--- a/mailnews/mime/src/mimei.cpp
+++ b/mailnews/mime/src/mimei.cpp
@@ -760,17 +760,18 @@ mime_find_class (const char *content_typ
           clazz = (MimeObjectClass *)&mimeExternalObjectClass;
         else {
           /* look at the file extension... less reliable, but still covered
              by the S/MIME specification (RFC 3851, section 3.2.1)  */
           char *name = (hdrs ? MimeHeaders_get_name(hdrs, opts) : nsnull);
           if (name) {
             char *suf = PL_strrchr(name, '.');
             if (suf &&
-                (!PL_strcasecmp(suf, ".p7c") || !PL_strcasecmp(suf, ".p7z")))
+                (!PL_strcasecmp(suf, ".p7c") || !PL_strcasecmp(suf, ".p7z") ||
+                 !PL_strcasecmp(suf, ".p7m")))
               clazz = (MimeObjectClass *)&mimeExternalObjectClass;
           }
           PR_Free(name);
         }
         PR_Free(st);
         PR_Free(ct);
     }
 #endif