[git] GpgOL - branch, master, updated. gpgol-2.0.6-8-gdc2f742

by Andre Heinecke cvs at cvs.gnupg.org
Thu Feb 22 09:58:20 CET 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  dc2f7424d081c1de0b639b3ab52aaa8092077c27 (commit)
       via  13ec7979aaff33e2d3112bc397ab0a291ffade2f (commit)
      from  153616194d2562c1aabda8b61d787d8f6cf5b3b6 (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 dc2f7424d081c1de0b639b3ab52aaa8092077c27
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Thu Feb 22 09:53:19 2018 +0100

    Print error when decryptresult is null
    
    * src/parsecontroller.cpp (format_error): Print an error
    when decrypt is requested but the result is null. This means
    that parsing failed.

diff --git a/src/parsecontroller.cpp b/src/parsecontroller.cpp
index 3754001..860c215 100644
--- a/src/parsecontroller.cpp
+++ b/src/parsecontroller.cpp
@@ -194,7 +194,15 @@ format_error(GpgME::DecryptionResult result, Protocol protocol)
   else
     {
       msg = _("Could not decrypt the data: ");
-      msg += result.error().asString();
+
+      if (result.isNull ())
+        {
+          msg += _("Failed to parse the mail.");
+        }
+      else
+        {
+          msg += result.error().asString();
+        }
     }
 
   if (gpgrt_asprintf (&buf, opt.prefer_html ? decrypt_template_html :
@@ -310,7 +318,7 @@ ParseController::parse()
         {
           verify = false;
         }
-      if (m_decrypt_result.error())
+      if (m_decrypt_result.error () || m_decrypt_result.isNull ())
         {
           m_error = format_error (m_decrypt_result, protocol);
         }

commit 13ec7979aaff33e2d3112bc397ab0a291ffade2f
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Thu Feb 22 09:50:28 2018 +0100

    Handle MS-TNEF PGP/MIME Mails
    
    * src/mapihelp.cpp (get_first_attach_mime_tag): Work with more
    then one attachment.
    (change_message_class_ipm_note): More ms-tnef handling.
    
    --
    Apparently Office365 converts mails from some to ms-tnef
    attachments. We still won't work for S/MIME ms-tnef attachments
    as I would need an example, but PGP/MIME should work now
    additionally to PGP/Inline.
    
    GnuPG-Bug-Id: T3802

diff --git a/src/mapihelp.cpp b/src/mapihelp.cpp
index a9c69c3..01aaf67 100644
--- a/src/mapihelp.cpp
+++ b/src/mapihelp.cpp
@@ -931,11 +931,11 @@ get_first_attach_mime_tag (LPMESSAGE message)
       return NULL;
     }
   n_attach = mapirows->cRows > 0? mapirows->cRows : 0;
-  if (n_attach != 1)
+  if (n_attach < 1)
     {
       FreeProws (mapirows);
       gpgol_release (mapitable);
-      log_debug ("%s:%s: not just one attachment", SRCNAME, __func__);
+      log_debug ("%s:%s: less then one attachment", SRCNAME, __func__);
       return NULL;
     }
   pos = 0;
@@ -1013,12 +1013,38 @@ change_message_class_ipm_note (LPMESSAGE message)
         }
       xfree (proto);
     }
+  else if (ct && !strcmp (ct, "application/ms-tnef"))
+    {
+      /* ms-tnef can either be inline PGP or PGP/MIME. First check
+         for inline and then look at the attachments if they look
+         like PGP /MIME .*/
+      newvalue = get_msgcls_from_pgp_lines (message);
+      if (!newvalue)
+        {
+          /* So no PGP Inline. Lets look at the attachment. */
+          char *attach_mime = get_first_attach_mime_tag (message);
+          if (!attach_mime)
+            {
+              xfree (ct);
+              return nullptr;
+            }
+          if (!strcmp (attach_mime, "application/pgp-encrypted"))
+            {
+              newvalue = xstrdup ("IPM.Note.GpgOL.MultipartEncrypted");
+              xfree (attach_mime);
+            }
+          else if (!strcmp (attach_mime, "application/pgp-signature"))
+            {
+              newvalue = xstrdup ("IPM.Note.GpgOL.MultipartSigned");
+              xfree (attach_mime);
+            }
+        }
+    }
   else if (!ct || !strcmp (ct, "text/plain") ||
            !strcmp (ct, "multipart/mixed") ||
            !strcmp (ct, "multipart/alternative") ||
            !strcmp (ct, "multipart/related") ||
-           !strcmp (ct, "text/html") ||
-           !strcmp (ct, "application/ms-tnef"))
+           !strcmp (ct, "text/html"))
     {
       /* It is quite common to have a multipart/mixed or alternative
          mail with separate encrypted PGP parts.  Look at the body to

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

Summary of changes:
 src/mapihelp.cpp        | 34 ++++++++++++++++++++++++++++++----
 src/parsecontroller.cpp | 12 ++++++++++--
 2 files changed, 40 insertions(+), 6 deletions(-)


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




More information about the Gnupg-commits mailing list