[git] GpgOL - branch, master, updated. gpgol-2.3.0-10-g3c0a66e

[email protected] (by Andre Heinecke)
Newsgroups gmane.comp.encryption.gpg.cvs
Message-ID <[email protected]>
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  3c0a66e402e84c0f8c5db4d2219eb8da6e5c0cac (commit)
      from  4384758e839e816033c07e78bbec1842af076793 (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 3c0a66e402e84c0f8c5db4d2219eb8da6e5c0cac
Author: Andre Heinecke <[email protected]>
Date:   Thu Sep 6 10:25:40 2018 +0200

    Ignore temporary recipient resolve errors
    
    * src/cryptocontroller.cpp (CryptController::resolve_keys):
    Add unlikely error handling if recipients could not be resolved here.
    * src/mail.cpp (Mail::getRecipients_o): Ignore error when
    getting recipients.
    
    --
    When editing the recipients of a draft Outlook still has an
    recipient object for the former recipient but does not provide
    properties on it. So the address resolution fails. We can
    treat the mail as having no recipients and only have a
    fatal error if we can't resolve recipients in the cryptcontroller.
    
    GnuPG-Bug-Id: T4129

diff --git a/src/cryptcontroller.cpp b/src/cryptcontroller.cpp
index afeb24d..df35d70 100644
--- a/src/cryptcontroller.cpp
+++ b/src/cryptcontroller.cpp
@@ -420,6 +420,23 @@ CryptController::resolve_keys ()
 {
   m_recipients.clear();
 
+  if (!m_recipient_addrs.size())
+    {
+      /* Should not happen. But we add it for better bug reports. */
+      const char *bugmsg = utf8_gettext ("Operation failed.\n\n"
+              "This is usually caused by a bug in GpgOL or an error in your setup.\n"
+              "Please see https://www.gpg4win.org/reporting-bugs.html "
+              "or ask your Administrator for support.");
+      char *buf;
+      gpgrt_asprintf (&buf, "Failed to resolve recipients.\n\n%s\n", bugmsg);
+      memdbg_alloc (buf);
+      gpgol_message_box (get_active_hwnd (),
+                         buf,
+                         _("GpgOL"), MB_OK);
+      xfree(buf);
+      return -1;
+    }
+
   if (opt.autoresolve && !resolve_keys_cached ())
     {
       log_debug ("%s:%s: resolved keys through the cache",
diff --git a/src/mail.cpp b/src/mail.cpp
index 7cd887a..d0d2d68 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -1858,18 +1858,9 @@ Mail::getRecipients_o () const
 
   if (err)
     {
-      /* Should not happen. But we add it for better bug reports. */
-      const char *bugmsg = utf8_gettext ("Operation failed.\n\n"
-              "This is usually caused by a bug in GpgOL or an error in your setup.\n"
-              "Please see https://www.gpg4win.org/reporting-bugs.html "
-              "or ask your Administrator for support.");
-      char *buf;
-      gpgrt_asprintf (&buf, "Failed to resolve recipients.\n\n%s\n", bugmsg);
-      memdbg_alloc (buf);
-      gpgol_message_box (get_active_hwnd (),
-                         buf,
-                         _("GpgOL"), MB_OK);
-      xfree(buf);
+      log_debug ("%s:%s: Failed to resolve recipients at this time.",
+                 SRCNAME, __func__);
+
     }
 
   return ret;

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

Summary of changes:
 src/cryptcontroller.cpp | 17 +++++++++++++++++
 src/mail.cpp            | 15 +++------------
 2 files changed, 20 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
GnuPG extension for MS Outlook
http://git.gnupg.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.