[git] GpgOL - branch, master, updated. gpgol-2.3.0-11-g8fb3524

by Andre Heinecke cvs at cvs.gnupg.org
Thu Sep 6 11:58:38 CEST 2018


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, master has been updated
       via  8fb3524262283c77a91f7e6c615d97f426455332 (commit)
      from  3c0a66e402e84c0f8c5db4d2219eb8da6e5c0cac (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 8fb3524262283c77a91f7e6c615d97f426455332
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Thu Sep 6 11:54:34 2018 +0200

    Fallback to MAPI SubmitMessage if OOM Send fails
    
    * src/common.h (ERR_SEND_FALLBACK_FAILED): New error code.
    * src/windowmessages.cpp (gpgol_window_proc): Fallback to SubmitMessage
    on OOM Send failure.
    
    --
    This is a workaround for a strange case where the write
    in the send event fails. This happens for example if
    office documents are attached to a mail. In that
    case we can fallback to MAPI as we already do when
    Outlooks internal Sign / Encrypt is selected.
    Maybe we could be so bold as to always send over
    MAPI.
    
    GnuPG-Bug-Id: T4131

diff --git a/src/common.h b/src/common.h
index 52099fd..583a63a 100644
--- a/src/common.h
+++ b/src/common.h
@@ -123,6 +123,7 @@ void i18n_init (void);
 #define ERR_WANTS_SEND_INLINE_BODY 3
 #define ERR_INLINE_BODY_TO_BODY 4
 #define ERR_INLINE_BODY_INV_STATE 5
+#define ERR_SEND_FALLBACK_FAILED 6
 #ifdef __cplusplus
 }
 #endif
diff --git a/src/windowmessages.cpp b/src/windowmessages.cpp
index c99806a..d34f26f 100644
--- a/src/windowmessages.cpp
+++ b/src/windowmessages.cpp
@@ -164,10 +164,33 @@ gpgol_window_proc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
                              SRCNAME, __func__, mail);
                 }
               // Finaly this should pass.
-              invoke_oom_method (mail->item (), "Send", NULL);
+              if (invoke_oom_method (mail->item (), "Send", NULL))
+                {
+                  log_error ("%s:%s: Send failed for %p. "
+                             "Trying SubmitMessage instead.",
+                             SRCNAME, __func__, mail);
+                  auto mail_message = get_oom_base_message (mail->item());
+                  // It's important we use the _base_ message here.
+                  mapi_save_changes (mail_message,
+                                     KEEP_OPEN_READWRITE | FORCE_SAVE);
+                  HRESULT hr = mail_message->SubmitMessage(0);
+                  gpgol_release (mail_message);
+
+                  if (hr == S_OK)
+                    {
+                      do_in_ui_thread_async (CLOSE, (LPVOID) mail);
+                    }
+                  else
+                    {
+                      log_error ("%s:%s: SubmitMessage Failed hr=0x%lx.",
+                                 SRCNAME, __func__, hr);
+                      gpgol_bug (mail->getWindow (),
+                                 ERR_SEND_FALLBACK_FAILED);
+                    }
+                }
               log_debug ("%s:%s:  Send for %p completed.",
                          SRCNAME, __func__, mail);
-              mail->releaseCurrentItem();
+              mail->releaseCurrentItem ();
               break;
             }
           case (BRING_TO_FRONT):

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

Summary of changes:
 src/common.h           |  1 +
 src/windowmessages.cpp | 27 +++++++++++++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)


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




More information about the Gnupg-commits mailing list