[git] GpgOL - branch, master, updated. gpgol-1.4.0-182-gf098d08

by Andre Heinecke cvs at cvs.gnupg.org
Mon Nov 28 12:41:10 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, master has been updated
       via  f098d08f7bb700e8b1e4868838c79aab844e3ffa (commit)
       via  3517d6d33ce05c9c55e3e5400bd1d7f5eee13419 (commit)
      from  72c2ebb31d68d2c1c9999cb5180964f834152891 (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 f098d08f7bb700e8b1e4868838c79aab844e3ffa
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Nov 28 12:38:44 2016 +0100

    Use inline text as body if no body seen
    
    * src/mimedataprovider.cpp (t2body): Use first text
    attachment as body if it is an inline attachment.
    (MimeDataProvider::create_attachment): Log the attachment
    name.
    
    --
    This fixes handling mails from kmail 1

diff --git a/src/mimedataprovider.cpp b/src/mimedataprovider.cpp
index 9e27844..bb74bc1 100644
--- a/src/mimedataprovider.cpp
+++ b/src/mimedataprovider.cpp
@@ -214,7 +214,14 @@ t2body (MimeDataProvider *provider, rfc822parse_t msg)
          if (s && strcmp (s, "inline"))
            not_inline_text = 1;
        */
-      is_text_attachment = 1;
+      if (ctx->body_seen)
+        {
+          /* Some MUA's like kontact e3.5 send the body as
+             an inline text attachment. So if we have not
+             seen the body yet we treat the first text/plain
+             element as the body and not as an inline attachment. */
+          is_text_attachment = 1;
+        }
       rfc822parse_release_field (field);
     }
 
@@ -864,6 +871,8 @@ MimeDataProvider::create_attachment()
         }
       else
         {
+          log_mime_parser ("%s:%s: Attachment filename: %s",
+                           SRCNAME, __func__, m_mime_ctx->mimestruct_cur->filename);
           attach->set_display_name (m_mime_ctx->mimestruct_cur->filename);
         }
     }

commit 3517d6d33ce05c9c55e3e5400bd1d7f5eee13419
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Nov 28 12:36:13 2016 +0100

    Handle detected attachments without filenames
    
    * src/mail.cpp (Mail::add_attachments): Ingore attachments without
    filenames.
    (Mail::parsing_done): Don't fail hard on attachment add failure.
    
    --
    This fixes the case if some mimestructure or unknown multipart/mixed
    attachments like the "private-headers" mimepart from Enigmail is
    present. Before this the first empty attachment filename would
    result in an error and no other attachments would have been shown.

diff --git a/src/mail.cpp b/src/mail.cpp
index 03e3347..1db0d6f 100644
--- a/src/mail.cpp
+++ b/src/mail.cpp
@@ -409,6 +409,12 @@ add_attachments(LPDISPATCH mail,
   int err = 0;
   for (auto att: attachments)
     {
+      if (att->get_display_name().empty())
+        {
+          log_error ("%s:%s: Ignoring attachment without display name.",
+                     SRCNAME, __func__);
+          continue;
+        }
       wchar_t* wchar_name = utf8_to_wchar (att->get_display_name().c_str());
       HANDLE hFile;
       wchar_t* wchar_file = get_tmp_outfile (GpgOLStr (att->get_display_name().c_str()),
@@ -433,12 +439,8 @@ add_attachments(LPDISPATCH mail,
         }
       xfree (wchar_file);
       xfree (wchar_name);
-      if (err)
-        {
-          return err;
-        }
     }
-  return 0;
+  return err;
 }
 
 GPGRT_LOCK_DEFINE(parser_lock);
@@ -663,7 +665,6 @@ Mail::parsing_done()
     {
       log_error ("%s:%s: Failed to update attachments.",
                  SRCNAME, __func__);
-      return;
     }
 
   /* Invalidate UI to set the correct sig status. */

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

Summary of changes:
 src/mail.cpp             | 13 +++++++------
 src/mimedataprovider.cpp | 11 ++++++++++-
 2 files changed, 17 insertions(+), 7 deletions(-)


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




More information about the Gnupg-commits mailing list