[git] GpgOL - branch, nomapi, updated. gpgol-1.4.0-135-gada53e4

by Andre Heinecke cvs at cvs.gnupg.org
Thu Nov 3 15:07:48 CET 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG extension for MS Outlook".

The branch, nomapi has been updated
       via  ada53e40e5c3907e8ae9539bd3212b57b48aba43 (commit)
       via  51e12dd2dddcdf91031b4f7eee0cfafbbd5a68ef (commit)
       via  86b7dcc999038425993dd0ed6b45df50d20a6831 (commit)
       via  4f2b76c0e1d4bb84e477dbf3fea1f6d23873e3de (commit)
       via  9a2ef44b0e36537cb91a35a107809a80f46bf499 (commit)
       via  80e972f8b4260c619c9eaea8c1762917a20c7a33 (commit)
       via  920a9c0d1a29a3d73b902d15ff6bd061ae414052 (commit)
      from  1d734d5938224e02236245223cf925a61563e2fc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ada53e40e5c3907e8ae9539bd3212b57b48aba43
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Thu Nov 3 14:46:57 2016 +0100

    Add explorer and explorers event handler
    
    * explorer-events.cpp: New. Invalidate ui on selection change.
    * explorers-events.cpp: New. Install event handler for new explorers.
    * gpgoladdin.cpp (GpgolAddin::~GpgolAddin): Release explorers event
    handler.
    (install_explorer_sinks): Install explorers and explorer event
    handler.
    (GpgolAddin::OnStartupComplete): call install_explorer_sinks
    
    --
    This fixes the problem that without another read by outlook
    the state of the ui might not have matched to the signature
    state, which is critical as it may have shown the wrong sigstate.

diff --git a/src/explorer-events.cpp b/src/explorer-events.cpp
new file mode 100644
index 0000000..f48f6ac
--- /dev/null
+++ b/src/explorer-events.cpp
@@ -0,0 +1,91 @@
+/* explorer-events.cpp - Event handling for the application.
+ *    Copyright (C) 2016 Intevation GmbH
+ *
+ * This file is part of GpgOL.
+ *
+ * GpgOL is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * GpgOL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* The event handler classes defined in this file follow the
+   general pattern that they implment the IDispatch interface
+   through the eventsink macros and handle event invocations
+   in their invoke methods.
+*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "eventsink.h"
+#include "ocidl.h"
+#include "common.h"
+#include "oomhelp.h"
+#include "mail.h"
+#include "gpgoladdin.h"
+
+/* Explorer Events */
+BEGIN_EVENT_SINK(ExplorerEvents, IDispatch)
+EVENT_SINK_DEFAULT_CTOR(ExplorerEvents)
+EVENT_SINK_DEFAULT_DTOR(ExplorerEvents)
+typedef enum
+  {
+    Activate = 0xF001,
+    AttachmentSelectionChange = 0xFC79,
+    BeforeFolderSwitch = 0xF003,
+    BeforeItemCopy = 0xFA0E,
+    BeforeItemCut = 0xFA0F,
+    BeforeItemPaste = 0xFA10,
+    BeforeMaximize = 0xFA11,
+    BeforeMinimize = 0xFA12,
+    BeforeMove = 0xFA13,
+    BeforeSize = 0xFA14,
+    BeforeViewSwitch = 0xF005,
+    Close = 0xF008,
+    Deactivate = 0xF006,
+    DisplayModeChange = 0xFC98,
+    FolderSwitch = 0xF002,
+    InlineResponse = 0xFC92,
+    InlineResponseClose = 0xFC96,
+    SelectionChange = 0xF007,
+    ViewSwitch = 0xF004
+  } ExplorerEvent;
+
+EVENT_SINK_INVOKE(ExplorerEvents)
+{
+  USE_INVOKE_ARGS
+  switch(dispid)
+    {
+      case SelectionChange:
+        {
+          log_oom_extra ("%s:%s: Selection change in explorer: %p",
+                         SRCNAME, __func__, this);
+          gpgoladdin_invalidate_ui ();
+          break;
+        }
+      case Close:
+        {
+          log_oom_extra ("%s:%s: Deleting event handler: %p",
+                         SRCNAME, __func__, this);
+          delete this;
+          return S_OK;
+        }
+      default:
+        break;
+#if 0
+        log_oom_extra ("%s:%s: Unhandled Event: %lx \n",
+                       SRCNAME, __func__, dispid);
+#endif
+    }
+  return S_OK;
+}
+END_EVENT_SINK(ExplorerEvents, IID_ExplorerEvents)
diff --git a/src/explorers-events.cpp b/src/explorers-events.cpp
new file mode 100644
index 0000000..476e11e
--- /dev/null
+++ b/src/explorers-events.cpp
@@ -0,0 +1,76 @@
+/* explorer-events.cpp - Event handling for the application.
+ *    Copyright (C) 2016 Intevation GmbH
+ *
+ * This file is part of GpgOL.
+ *
+ * GpgOL is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * GpgOL is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* The event handler classes defined in this file follow the
+   general pattern that they implment the IDispatch interface
+   through the eventsink macros and handle event invocations
+   in their invoke methods.
+*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "eventsink.h"
+#include "eventsinks.h"
+#include "ocidl.h"
+#include "common.h"
+#include "oomhelp.h"
+#include "mail.h"
+#include "gpgoladdin.h"
+
+/* Explorers Events */
+BEGIN_EVENT_SINK(ExplorersEvents, IDispatch)
+EVENT_SINK_DEFAULT_CTOR(ExplorersEvents)
+EVENT_SINK_DEFAULT_DTOR(ExplorersEvents)
+typedef enum
+  {
+    NewExplorer = 0xF001,
+  } ExplorersEvent;
+
+/* Don't confuse with ExplorerEvents. ExplorerEvents is
+   the actual event sink for explorer events. This just
+   ensures that we create such a sink for each new explorer. */
+EVENT_SINK_INVOKE(ExplorersEvents)
+{
+  USE_INVOKE_ARGS
+  switch(dispid)
+    {
+      case NewExplorer:
+        {
+          if (parms->cArgs != 1 || !(parms->rgvarg[0].vt & VT_DISPATCH))
+            {
+              log_debug ("%s:%s: No explorer in new Explorer.",
+                         SRCNAME, __func__);
+              break;
+            }
+          if (!install_ExplorerEvents_sink (parms->rgvarg[0].pdispVal))
+            {
+              log_error ("%s:%s: Failed to install Explorer event sink.",
+                         SRCNAME, __func__);
+              break;
+
+            }
+          gpgoladdin_invalidate_ui ();
+        }
+      default:
+        break;
+    }
+  return S_OK;
+}
+END_EVENT_SINK(ExplorersEvents, IID_ExplorersEvents)
diff --git a/src/gpgoladdin.cpp b/src/gpgoladdin.cpp
index a9623cd..7c0c4e9 100644
--- a/src/gpgoladdin.cpp
+++ b/src/gpgoladdin.cpp
@@ -171,8 +171,12 @@ STDMETHODIMP GpgolAddinFactory::CreateInstance (LPUNKNOWN punk, REFIID riid,
 
    The ref count is set by the factory after creation.
 */
-GpgolAddin::GpgolAddin (void) : m_lRef(0), m_application(0),
-  m_addin(0), m_applicationEventSink(0), m_disabled(false)
+GpgolAddin::GpgolAddin (void) : m_lRef(0),
+  m_application(nullptr),
+  m_addin(nullptr),
+  m_applicationEventSink(nullptr),
+  m_explorersEventSink(nullptr),
+  m_disabled(false)
 {
   read_options ();
   use_mime_ui = opt.mime_ui;
@@ -190,6 +194,7 @@ GpgolAddin::~GpgolAddin (void)
     }
   log_debug ("%s:%s: Releasing Application Event Sink;",
              SRCNAME, __func__);
+  gpgol_release (m_explorersEventSink);
   gpgol_release (m_applicationEventSink);
 
   engine_deinit ();
@@ -361,6 +366,50 @@ check_html_preferred()
     }
 }
 
+static LPDISPATCH
+install_explorer_sinks (LPDISPATCH application)
+{
+
+  LPDISPATCH explorers = get_oom_object (application, "Explorers");
+
+  if (!explorers)
+    {
+      log_error ("%s:%s: No explorers object",
+                 SRCNAME, __func__);
+      return nullptr;
+    }
+  int count = get_oom_int (explorers, "Count");
+
+  for (int i = 1; i <= count; i++)
+    {
+      std::string item = "Item(";
+      item += std::to_string (i) + ")";
+      LPDISPATCH explorer = get_oom_object (explorers, item.c_str());
+      if (!explorer)
+        {
+          log_error ("%s:%s: failed to get explorer %i",
+                     SRCNAME, __func__, i);
+          continue;
+        }
+      /* Explorers delete themself in the close event of the explorer. */
+      LPDISPATCH sink = install_ExplorerEvents_sink (explorer);
+      if (!sink)
+        {
+          log_error ("%s:%s: failed to create eventsink for explorer %i",
+                     SRCNAME, __func__, i);
+
+        }
+      else
+        {
+          log_oom_extra ("%s:%s: created sink %p for explorer %i",
+                         SRCNAME, __func__, sink, i);
+        }
+      gpgol_release (explorer);
+    }
+  /* Now install the event sink to handle new explorers */
+  return install_ExplorersEvents_sink (explorers);
+}
+
 STDMETHODIMP
 GpgolAddin::OnStartupComplete (SAFEARRAY** custom)
 {
@@ -386,7 +435,8 @@ GpgolAddin::OnStartupComplete (SAFEARRAY** custom)
   ensure_category_exists (m_application, decCategory, 8);
   ensure_category_exists (m_application, verifyCategory, 5);
   install_forms ();
-  m_applicationEventSink = install_ApplicationEvents_sink(m_application);
+  m_applicationEventSink = install_ApplicationEvents_sink (m_application);
+  m_explorersEventSink = install_explorer_sinks (m_application);
   check_html_preferred ();
   return S_OK;
 }
diff --git a/src/gpgoladdin.h b/src/gpgoladdin.h
index d201b75..a871348 100644
--- a/src/gpgoladdin.h
+++ b/src/gpgoladdin.h
@@ -210,6 +210,7 @@ private:
   LPDISPATCH m_application;
   LPDISPATCH m_addin;
   LPDISPATCH m_applicationEventSink;
+  LPDISPATCH m_explorersEventSink;
   LPDISPATCH m_ribbon_control;
   bool m_disabled;
 

commit 51e12dd2dddcdf91031b4f7eee0cfafbbd5a68ef
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Thu Nov 3 13:39:54 2016 +0100

    Add mapi helpers for uuid retrieval
    
    * src/mapihelp.cpp, src/mapihelp.h: (get_gpgoluid_tag)
    (mapi_get_uid): New.
    
    --
    Used in some experiments regarding UUID structures.

diff --git a/src/mapihelp.cpp b/src/mapihelp.cpp
index d4407e4..2ebe333 100644
--- a/src/mapihelp.cpp
+++ b/src/mapihelp.cpp
@@ -281,6 +281,61 @@ get_internetcharsetbody_tag (LPMESSAGE message, ULONG *r_tag)
   return result;
 }
 
+/* Return the property tag for GpgOL UUID Info.  */
+static int
+get_gpgoluid_tag (LPMESSAGE message, ULONG *r_tag)
+{
+  if (!(*r_tag = create_gpgol_tag (message, L"GpgOL UID", __func__)))
+    return -1;
+  *r_tag |= PT_UNICODE;
+  return 0;
+}
+
+char *
+mapi_get_uid (LPDISPATCH mail)
+{
+  /* If the UUID is not in OOM maybe we find it in mapi. */
+  LPMESSAGE msg = get_oom_base_message (mail);
+  if (!msg)
+    {
+      log_debug ("%s:%s: Failed to get message for '%p'",
+                 SRCNAME, __func__, mail);
+      gpgol_release (msg);
+    }
+  ULONG tag;
+  if (get_gpgoluid_tag (msg, &tag))
+    {
+      log_debug ("%s:%s: Failed to get tag for '%p'",
+                 SRCNAME, __func__, mail);
+      gpgol_release (msg);
+      return NULL;
+    }
+  LPSPropValue propval = NULL;
+  HRESULT hr = HrGetOneProp ((LPMAPIPROP)msg, tag, &propval);
+  gpgol_release (msg);
+  if (hr)
+    {
+      log_debug ("%s:%s: Failed to get prop for '%p'",
+                 SRCNAME, __func__, mail);
+      return NULL;
+    }
+  char *ret = NULL;
+  if (PROP_TYPE (propval->ulPropTag) == PT_UNICODE)
+    {
+      ret = wchar_to_utf8 (propval->Value.lpszW);
+      log_debug ("%s:%s: Fund uuid in MAPI for %p",
+                 SRCNAME, __func__, mail);
+    }
+  else if (PROP_TYPE (propval->ulPropTag) == PT_STRING8)
+    {
+      ret = strdup (propval->Value.lpszA);
+      log_debug ("%s:%s: Fund uuid in MAPI for %p",
+                 SRCNAME, __func__, mail);
+    }
+  MAPIFreeBuffer (propval);
+  return ret;
+}
+
 
 /* A Wrapper around the SaveChanges method.  This function should be
    called indirect through the mapi_save_changes macro.  Returns 0 on
diff --git a/src/mapihelp.h b/src/mapihelp.h
index 63b9d57..9bcd58f 100644
--- a/src/mapihelp.h
+++ b/src/mapihelp.h
@@ -130,6 +130,8 @@ int mapi_mark_or_create_moss_attach (LPMESSAGE message, msgtype_t msgtype);
 
 /* Copy the MAPI body to a PGPBODY type attachment. */
 int mapi_body_to_attachment (LPMESSAGE message);
+
+char * mapi_get_uid (LPDISPATCH mail);
 #ifdef __cplusplus
 }
 #endif

commit 86b7dcc999038425993dd0ed6b45df50d20a6831
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Thu Nov 3 10:50:49 2016 +0100

    Allow to reset uuid
    
    * src/mail.cpp (Mail::set_uuid): Set uuid even if the mail
    object already tracks a uuid.
    * src/oomhelp.cpp (get_unique_id): Extend with uuid param.
    * src/oomhelp.h: Update accordingly
    
    --
    This is important if we close with discard changes to set our
    uuid again after the close.

diff --git a/src/mail.cpp b/src/mail.cpp
index 2cc7acf..3e2aa88 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -1186,21 +1186,38 @@ Mail::is_signed()
 int
 Mail::set_uuid()
 {
+  char *uuid;
   if (!m_uuid.empty())
     {
-      return 0;
+      /* This codepath is reached by decrypt again after a
+         close with discard changes. The close discarded
+         the uuid on the OOM object so we have to set
+         it again. */
+      log_debug ("%s:%s: Resetting uuid for %p to %s",
+                 SRCNAME, __func__, this,
+                 m_uuid.c_str());
+      uuid = get_unique_id (m_mailitem, 1, m_uuid.c_str());
+    }
+  else
+    {
+      uuid = get_unique_id (m_mailitem, 1, nullptr);
     }
-  char *uuid = get_unique_id (m_mailitem, 1);
 
   if (!uuid)
     {
-      log_debug ("%s:%s: Failed to get uuid for %p",
+      log_debug ("%s:%s: Failed to get/set uuid for %p",
                  SRCNAME, __func__, m_mailitem);
       return -1;
     }
-  m_uuid = uuid;
+  if (m_uuid.empty())
+    {
+      m_uuid = uuid;
+      g_uid_map.insert (std::pair<std::string, Mail *> (m_uuid, this));
+      log_debug ("%s:%s: uuid for %p is now %s",
+                 SRCNAME, __func__, this,
+                 m_uuid.c_str());
+    }
   xfree (uuid);
-  g_uid_map.insert (std::pair<std::string, Mail *> (m_uuid, this));
   return 0;
 }
 
diff --git a/src/oomhelp.cpp b/src/oomhelp.cpp
index 9591f97..bb8df36 100644
--- a/src/oomhelp.cpp
+++ b/src/oomhelp.cpp
@@ -1603,7 +1603,7 @@ generate_uid ()
 }
 
 char *
-get_unique_id (LPDISPATCH mail, int create)
+get_unique_id (LPDISPATCH mail, int create, const char *uuid)
 {
   if (!mail)
     {
@@ -1614,8 +1614,9 @@ get_unique_id (LPDISPATCH mail, int create)
   char *uid = get_pa_string (mail, GPGOL_UID_DASL);
   if (!uid)
     {
-      log_debug ("%s:%s: No uuid found for '%p'",
+      log_debug ("%s:%s: No uuid found in oom for '%p'",
                  SRCNAME, __func__, mail);
+
       if (!create)
         {
           return NULL;
@@ -1627,7 +1628,15 @@ get_unique_id (LPDISPATCH mail, int create)
                  SRCNAME, __func__, uid, mail);
       return uid;
     }
-  char *newuid = generate_uid ();
+  char *newuid;
+  if (!uuid)
+    {
+      newuid = generate_uid ();
+    }
+  else
+    {
+      newuid = strdup (uuid);
+    }
   int ret = put_pa_string (mail, GPGOL_UID_DASL, newuid);
 
   if (ret)
diff --git a/src/oomhelp.h b/src/oomhelp.h
index f04487b..74e7faf 100644
--- a/src/oomhelp.h
+++ b/src/oomhelp.h
@@ -290,10 +290,13 @@ remove_category (LPDISPATCH mail, const char *category);
    a new uuid will be added if none exists and the
    value of that uuid returned.
 
+   The optinal uuid value can be set to be used
+   as uuid instead of a generated one.
+
    Return value has to be freed by the caller.
    */
 char *
-get_unique_id (LPDISPATCH mail, int create);
+get_unique_id (LPDISPATCH mail, int create, const char* uuid);
 
 #ifdef __cplusplus
 }

commit 4f2b76c0e1d4bb84e477dbf3fea1f6d23873e3de
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Thu Nov 3 10:48:52 2016 +0100

    Add close function to Mails
    
    * src/mail.cpp (Mail::close): New, close a mail.
    
    --
    Closing a Mail with discard changes prevents the Save Changes
    popup without the requirement for a revert.

diff --git a/src/mail.cpp b/src/mail.cpp
index bc7a985..2cc7acf 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -978,6 +978,35 @@ Mail::close_inspector ()
   return 0;
 }
 
+int
+Mail::close (bool discard)
+{
+  VARIANT aVariant[1];
+  DISPPARAMS dispparams;
+
+  dispparams.rgvarg = aVariant;
+  dispparams.rgvarg[0].vt = VT_INT;
+  dispparams.rgvarg[0].intVal = discard ? 1 : 0;
+  dispparams.cArgs = 1;
+  dispparams.cNamedArgs = 0;
+
+  int rc = invoke_oom_method_with_parms (m_mailitem, "Close",
+                                         NULL, &dispparams);
+
+  /* Reset the uuid after discarding all changes in the oom
+     so that we can still find ourself. */
+  set_uuid ();
+
+  /* Now that we have closed it with discard changes we no
+     longer need to wipe the mail because the plaintext was
+     discarded. */
+  if (!rc)
+    {
+      m_needs_wipe = false;
+    }
+  return rc;
+}
+
 static const UserID
 get_uid_for_sender (const Key k, const char *sender)
 {
diff --git a/src/mail.h b/src/mail.h
index d150acc..0385fbd 100644
--- a/src/mail.h
+++ b/src/mail.h
@@ -254,6 +254,10 @@ public:
       by the caller. */
   char ** get_recipients () const;
 
+  /** Call close with discard changes true or false
+      returns the value of the oom call. */
+  int close (bool discard);
+
 private:
   void update_categories ();
   void update_body ();

commit 9a2ef44b0e36537cb91a35a107809a80f46bf499
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Thu Nov 3 10:47:49 2016 +0100

    Add extra debug output for mail destruction
    
    * src/mail.cpp (Mail::~Mail): Print uuid in dtor

diff --git a/src/mail.cpp b/src/mail.cpp
index c03cb3b..bc7a985 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -142,6 +142,8 @@ Mail::~Mail()
 
   xfree (m_sender);
   gpgol_release(m_mailitem);
+  log_oom_extra ("%s:%s: destroyed: %p uuid: %s",
+                 SRCNAME, __func__, this, m_uuid.c_str());
 }
 
 Mail *

commit 80e972f8b4260c619c9eaea8c1762917a20c7a33
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed Nov 2 11:34:16 2016 +0100

    Disable revert all mails on quit
    
    * src/application-events.cpp (EVENT_SINK_INVOKE): Disable
    revert_all_mails.
    
    --
    Reverting all mails in quit brings outlook into a buggy state
    in that it syncs the mail endlessly after the next start.

diff --git a/src/application-events.cpp b/src/application-events.cpp
index dbce53d..f70c44a 100644
--- a/src/application-events.cpp
+++ b/src/application-events.cpp
@@ -97,7 +97,11 @@ EVENT_SINK_INVOKE(ApplicationEvents)
       case Quit:
         {
           log_debug ("%s:%s: Quit event", SRCNAME, __func__);
-          Mail::revert_all_mails();
+          /* Reverting all mails here can cause outlook to go
+             into an endless sync state after the next start.
+             So we can't do it. Needs handling.
+             Mail::revert_all_mails();
+             */
         }
       default:
         log_oom_extra ("%s:%s: Unhandled Event: %lx \n",

commit 920a9c0d1a29a3d73b902d15ff6bd061ae414052
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Oct 31 12:36:01 2016 +0100

    Install forms for InfoPath msg classes.
    
    * forms/gpgol-form-encrypted.cfg,
     forms/gpgol-form-signed.cfg: New.
    * src/olflange.cpp (install_forms): Install new forms.
    * src/mimemaker.cpp (finalize_message): Use InfoPath msg classes.
    
    --
    This fixes that Outlook shows all our Mails as S/MIME signed
    because we set the S/MIME message class when sending to enable
    the behavior that it takes the MIME structure from the first
    attachment.
    
    It also fixes the display of reverted mails which was previously
    wrong.

diff --git a/forms/gpgol-form-encrypted.cfg b/forms/gpgol-form-encrypted.cfg
new file mode 100644
index 0000000..12f7140
--- /dev/null
+++ b/forms/gpgol-form-encrypted.cfg
@@ -0,0 +1,34 @@
+[Description]
+MessageClass=IPM.Note.InfoPathForm.GpgOL.SMIME.MultipartSigned
+DesignerRuntimeGuid={0006F020-0000-0000-C000-000000000046}
+CLSID={00061033-0000-0000-C000-000000000046}
+DisplayName=Form for GpgOL sent encrypted Mails
+Category=Standard
+Subcategory=Formular
+Comment=
+LargeIcon=encr-l.ico
+SmallIcon=encr-s.ico
+VersionMajor=1
+VersionMinor=0
+Hidden=1
+Owner=Public Domain
+
+[Properties]
+
+[Verbs]
+Verb1=1
+
+[Verb.1]
+DisplayName=&Open
+Code=0
+Flags=0
+Attribs=2
+
+[Extensions]
+Extensions1=1
+
+[Extension.1]
+Type=30
+NmidPropset={00020D0C-0000-0000-C000-000000000046}
+NmidInteger=1
+Value=1011111111111111
diff --git a/forms/gpgol-form-signed.cfg b/forms/gpgol-form-signed.cfg
new file mode 100644
index 0000000..acb562d
--- /dev/null
+++ b/forms/gpgol-form-signed.cfg
@@ -0,0 +1,34 @@
+[Description]
+MessageClass=IPM.Note.InfoPathForm.GpgOLS.SMIME.MultipartSigned
+DesignerRuntimeGuid={0006F020-0000-0000-C000-000000000046}
+CLSID={00061033-0000-0000-C000-000000000046}
+DisplayName=Form for GpgOL sent signed Mails
+Category=Standard
+Subcategory=Formular
+Comment=
+LargeIcon=sign-l.ico
+SmallIcon=sign-s.ico
+VersionMajor=1
+VersionMinor=0
+Hidden=1
+Owner=Public Domain
+
+[Properties]
+
+[Verbs]
+Verb1=1
+
+[Verb.1]
+DisplayName=&Open
+Code=0
+Flags=0
+Attribs=2
+
+[Extensions]
+Extensions1=1
+
+[Extension.1]
+Type=30
+NmidPropset={00020D0C-0000-0000-C000-000000000046}
+NmidInteger=1
+Value=1011111111111111
diff --git a/src/mimemaker.cpp b/src/mimemaker.cpp
index 39a6a38..edb9980 100644
--- a/src/mimemaker.cpp
+++ b/src/mimemaker.cpp
@@ -1098,7 +1098,14 @@ finalize_message (LPMESSAGE message, mapi_attach_item_t *att_table,
 
   /* Set the message class.  */
   prop.ulPropTag = PR_MESSAGE_CLASS_A;
-  prop.Value.lpszA = GpgOLStr ("IPM.Note.SMIME.MultipartSigned");
+  if (encrypt)
+    {
+      prop.Value.lpszA = GpgOLStr ("IPM.Note.InfoPathForm.GpgOL.SMIME.MultipartSigned");
+    }
+  else
+    {
+      prop.Value.lpszA = GpgOLStr ("IPM.Note.InfoPathForm.GpgOLS.SMIME.MultipartSigned");
+    }
   hr = message->SetProps(1, &prop, NULL);
   if (hr)
     {
diff --git a/src/olflange.cpp b/src/olflange.cpp
index 66b5b68..9f51182 100644
--- a/src/olflange.cpp
+++ b/src/olflange.cpp
@@ -795,6 +795,10 @@ install_forms (void)
       "gpgol",
       "gpgol-ms",
       "gpgol-cs",
+       /* The InfoPath we use for sending, to get outlook
+          to do the S/MIME handling. */
+      "gpgol-form-signed",
+      "gpgol-form-encrypted",
       NULL,
     };
   int formidx;

-----------------------------------------------------------------------

Summary of changes:
 forms/{gpgol.cfg => gpgol-form-encrypted.cfg} |  4 +-
 forms/{gpgol-cs.cfg => gpgol-form-signed.cfg} |  4 +-
 src/application-events.cpp                    |  6 +-
 src/explorer-events.cpp                       | 91 +++++++++++++++++++++++++++
 src/explorers-events.cpp                      | 76 ++++++++++++++++++++++
 src/gpgoladdin.cpp                            | 56 ++++++++++++++++-
 src/gpgoladdin.h                              |  1 +
 src/mail.cpp                                  | 58 +++++++++++++++--
 src/mail.h                                    |  4 ++
 src/mapihelp.cpp                              | 55 ++++++++++++++++
 src/mapihelp.h                                |  2 +
 src/mimemaker.cpp                             |  9 ++-
 src/olflange.cpp                              |  4 ++
 src/oomhelp.cpp                               | 15 ++++-
 src/oomhelp.h                                 |  5 +-
 15 files changed, 372 insertions(+), 18 deletions(-)
 copy forms/{gpgol.cfg => gpgol-form-encrypted.cfg} (81%)
 copy forms/{gpgol-cs.cfg => gpgol-form-signed.cfg} (81%)
 create mode 100644 src/explorer-events.cpp
 create mode 100644 src/explorers-events.cpp


hooks/post-receive
-- 
GnuPG extension for MS Outlook
http://git.gnupg.org




More information about the Gnupg-commits mailing list