Change S/MIME Message Class handling
authorAndre Heinecke <aheinecke@gnupg.org>
Mon, 20 May 2019 11:44:06 +0000 (13:44 +0200)
committerAndre Heinecke <aheinecke@gnupg.org>
Mon, 20 May 2019 11:47:10 +0000 (13:47 +0200)
* src/olflange.cpp (install_forms): Register new icons
* src/mimemaker.cpp (finalize_message): Use SMIME for encryption.
* src/revert.cpp (gpgol_mailitem_revert): Use standard classes.
* src/mapihelp.cpp (change_message_class_ipm_note_smime)
(change_message_class_ipm_note_secure_cex)
(string_to_type)
(mapi_change_message_class): Split up MultipartSigned and
SM.MultipartSigned

--
This allows us to use better icons which should lead to
less confusion.

Interoperability issues are also addressed by changing
the message class to a value more standard.

GnuPG-Bug-Id: T4278

src/mapihelp.cpp
src/mimemaker.cpp
src/olflange.cpp
src/revert.cpp

index 8791141..96b5240 100644 (file)
@@ -1236,7 +1236,7 @@ change_message_class_ipm_note_smime (LPMESSAGE message)
                    || !strcmp (proto, "application/x-pkcs7-signature")))
         {
           log_debug ("%s:%s:   protocol is '%s'", SRCNAME, __func__, proto);
-          newvalue = xstrdup ("IPM.Note.GpgOL.MultipartSigned");
+          newvalue = xstrdup ("IPM.Note.GpgOL.SM.MultipartSigned");
         }
       else
         {
@@ -1369,7 +1369,7 @@ change_message_class_ipm_note_secure_cex (LPMESSAGE message, int is_cexenc)
               && (!strcmp (proto, "application/pkcs7-signature")
                   || !strcmp (proto, "application/x-pkcs7-signature")))
             {
-              newvalue = xstrdup ("IPM.Note.GpgOL.MultipartSigned");
+              newvalue = xstrdup ("IPM.Note.GpgOL.SM.MultipartSigned");
             }
           else if (!strcmp (ct, "multipart/signed")
                    && (!strcmp (proto, "application/pgp-signature")))
@@ -1454,6 +1454,10 @@ string_to_type (const char *s)
         {
           TRETURN MSGTYPE_GPGOL;
         }
+      else if (!strcmp (s, ".SM.MultipartSigned"))
+        {
+          TRETURN MSGTYPE_GPGOL_MULTIPART_SIGNED;
+        }
       else if (!strcmp (s, ".MultipartSigned"))
         {
           TRETURN MSGTYPE_GPGOL_MULTIPART_SIGNED;
@@ -1578,8 +1582,8 @@ mapi_change_message_class (LPMESSAGE message, int sync_override,
           else
             {
               xfree (tmp);
-              newvalue = (char*)xmalloc (strlen (s) + 1);
-              strcpy (stpcpy (newvalue, "IPM.Note.GpgOL"), s+14);
+              gpgrt_asprintf (&newvalue, "IPM.Note.GpgOL.SM%s", s+14);
+              memdbg_alloc (newvalue);
             }
         }
       else if (!strcmp (s, "IPM.Note.SMIME.MultipartSigned"))
index 2199965..79834b8 100644 (file)
@@ -1229,9 +1229,7 @@ finalize_message (LPMESSAGE message, mapi_attach_item_t *att_table,
          not immediately showing the GpgOL icon but gives other
          clients that do not have GpgOL installed a better chance
          to handle the mail. */
-      /* FIXME according to MSOXSMIME it should be possible to use
-       * IPM.Note.SMIME here for encrypted mails */
-      prop.Value.lpszA = encrypt ? xstrdup ("IPM.Note.SMIME.MultipartSigned") :
+      prop.Value.lpszA = encrypt ? xstrdup ("IPM.Note.SMIME") :
                                    xstrdup ("IPM.Note.SMIME.MultipartSigned");
     }
   else if (encrypt)
index f1dd3c3..9c8f779 100644 (file)
@@ -379,6 +379,10 @@ install_forms (void)
           to do the S/MIME handling. */
       "gpgol-form-signed",
       "gpgol-form-encrypted",
+      /* SMIME Forms with similar icons to outlooks S/MIME */
+      "gpgol-form-signed-smime",
+      "gpgol-form-signed-smime-opaque",
+      "gpgol-form-encrypted-smime",
       NULL,
     };
   int formidx;
index 2b5db94..eceef6f 100644 (file)
@@ -326,13 +326,13 @@ gpgol_mailitem_revert (LPDISPATCH mailitem)
       else if (msgtype == MSGTYPE_GPGOL_MULTIPART_SIGNED)
         {
           prop.Value.lpszA =
-            (char*) "IPM.Note.InfoPathForm.GpgOLS.SMIME.MultipartSigned";
+            (char*) "IPM.Note.SMIME.MultipartSigned";
           hr = HrSetOneProp (message, &prop);
         }
       else
         {
           prop.Value.lpszA =
-            (char*) "IPM.Note.InfoPathForm.GpgOL.SMIME.MultipartSigned";
+            (char*) "IPM.Note.SMIME";
           hr = HrSetOneProp (message, &prop);
         }
       if (hr)