[git] GpgOL - branch, nomapi, updated. gpgol-1.4.0-79-gfb3c90c

by Andre Heinecke cvs at cvs.gnupg.org
Wed Oct 12 10:40:06 CEST 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  fb3c90c8852edf41ac97ef3e821228dc4a54bafe (commit)
       via  4d3b317569e3637692f7f925064cccf31d6671f9 (commit)
      from  b4708d27c6a03dbcfb9eb5a29be15fff159be662 (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 fb3c90c8852edf41ac97ef3e821228dc4a54bafe
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed Oct 12 10:37:47 2016 +0200

    tests: Add two more multipart-signed tests
    
    * tests/data/openpgp-signed-no-attach-gpgol.mbox,
    tests/data/openpgp-signed-no-attach-gpgol.plain,
    tests/data/openpgp-signed-two-attachments.mbox,
    tests/data/openpgp-signed-two-attachments.plain: New.
    * tests/t-parser.cpp: Use them.
    
    --
    The attachment test includes inline attachments.
    The gpgol test adds a message like it is seen by gpgol
    (Without headers)

diff --git a/tests/data/openpgp-signed-no-attach-gpgol.mbox b/tests/data/openpgp-signed-no-attach-gpgol.mbox
new file mode 100644
index 0000000..8e022f0
--- /dev/null
+++ b/tests/data/openpgp-signed-no-attach-gpgol.mbox
@@ -0,0 +1,32 @@
+MIME-Version: 1.0
+Content-Type: multipart/signed; boundary="nextPart1693035.rOZRFYHO8F"; micalg="pgp-sha256"; protocol="application/pgp-signature"
+
+--nextPart1693035.rOZRFYHO8F
+Content-Transfer-Encoding: quoted-printable
+Content-Type: text/plain; charset="iso-8859-1"
+
+Hallo Welt!
+=2D-=20
+Andre Heinecke |  ++49-541-335083-262  | http://www.intevation.de/
+Intevation GmbH, Neuer Graben 17, 49074 Osnabr=FCck | AG Osnabr=FCck, H=
+R B 18998
+Gesch=E4ftsf=FChrer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wa=
+gner
+--nextPart1693035.rOZRFYHO8F
+Content-Type: application/pgp-signature; name="signature.asc"
+Content-Description: This is a digitally signed message part.
+Content-Transfer-Encoding: 7Bit
+
+-----BEGIN PGP SIGNATURE-----
+
+iQEcBAABCAAGBQJX49NGAAoJEI2YYMWPJG3mYDsH/3DuwYTTYSxYdk3WecCn2TPx
+UzzUB332tVE5SLzZcvH426jFwQ2qt7/f8kWjmr5+GCOenM6Nzz1FbC4K3ARuF4c3
+fZDlFegpsRg735uV8vjEEwQVkipyYMHeUJJ6d5O4FxF8q0dfkjNM53EC3cLiuKF7
+P4AjRZBycPyMf7XBaaU0zfMQkC+UkiBXMrcITQoPSSgbadlxLEc4oJIdD8zZDFVx
+q2I8RFoKzVpHMn/OjBfXi94JVz7wCTa4wGG/emxoamRvqMp2S5SWPNps79/Trvzv
+64F+3UalXGBfDybyUYgGb0wLtXnbFux03GJoY20NMjsMRBBKYfqMQbh0m8VZSI4=
+=UY6M
+-----END PGP SIGNATURE-----
+
+--nextPart1693035.rOZRFYHO8F--
+
diff --git a/tests/data/openpgp-signed-no-attach-gpgol.plain b/tests/data/openpgp-signed-no-attach-gpgol.plain
new file mode 100644
index 0000000..aba8dba
--- /dev/null
+++ b/tests/data/openpgp-signed-no-attach-gpgol.plain
@@ -0,0 +1,5 @@
+Hallo Welt!
+-- 
+Andre Heinecke |  ++49-541-335083-262  | http://www.intevation.de/
+Intevation GmbH, Neuer Graben 17, 49074 Osnabrück | AG Osnabrück, HR B 18998
+Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner
\ No newline at end of file
diff --git a/tests/data/openpgp-signed-two-attachments.mbox b/tests/data/openpgp-signed-two-attachments.mbox
new file mode 100644
index 0000000..462f62a
--- /dev/null
+++ b/tests/data/openpgp-signed-two-attachments.mbox
@@ -0,0 +1,54 @@
+From: firstname.lastname at example.com
+To: test at kolab.org
+Subject: OpenPGP signed with 2 text attachments
+Date: Sun, 30 Aug 2015 12:02:56 +0200
+Message-ID: <2033829.IGepAdxqt9 at vkpc5>
+X-KMail-Identity: 402312391
+X-KMail-Dictionary: en_US
+User-Agent: KMail/5.0.42 pre (Linux/3.16.6-2-desktop; KDE/5.14.0; x86_64; ; )
+MIME-Version: 1.0
+Content-Type: multipart/signed; boundary="nextPart3682207.KLrp2sxpbf"; micalg="pgp-sha1"; protocol="application/pgp-signature"
+
+--nextPart3682207.KLrp2sxpbf
+Content-Type: multipart/mixed; boundary="nextPart2397422.QDHKUNdbyg"
+Content-Transfer-Encoding: 7Bit
+
+This is a multi-part message in MIME format.
+
+--nextPart2397422.QDHKUNdbyg
+Content-Transfer-Encoding: 7Bit
+Content-Type: text/plain; charset="us-ascii"
+
+this is the main body text
+--nextPart2397422.QDHKUNdbyg
+Content-Disposition: inline; filename="attachment1.txt"
+Content-Transfer-Encoding: 7Bit
+Content-Type: text/plain; charset="utf-8"; name="attachment1.txt"
+
+this is attachment one
+--nextPart2397422.QDHKUNdbyg
+Content-Disposition: inline; filename="attachment2.txt"
+Content-Transfer-Encoding: 7Bit
+Content-Type: text/plain; charset="utf-8"; name="attachment2.txt"
+
+this is attachment two
+--nextPart2397422.QDHKUNdbyg--
+
+--nextPart3682207.KLrp2sxpbf
+Content-Type: application/pgp-signature; name="signature.asc"
+Content-Description: This is a digitally signed message part.
+Content-Transfer-Encoding: 7Bit
+
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2
+
+iQEVAwUAVeLU0I2YYMWPJG3mAQL/fgf+LXmO7bKafdd4g5OOVHHyXRprVmX/6hBq
+mZoor29KLIHkvAH9OJi4qBy/ZKwqqKLfttLzHb2UaAfl5kn4f0ckmnwUhU7u32Sm
+JZ0Q50SxrRVFRyvTvPG22ho9IwQUO1YSZrL4wO9v8ZBQ3vkfpmAiUQVxPQMINc8L
+i68xQEm4y1Dtoc+DTUkoIMeOOPnEl6PTMPrwn906K0r30hI4788fEGRn6uOXb+vD
+G/ISlXu+JHIxxf/J5/jVjKNbra+trrfSPzB3piJIjBLEPO5FvLx8SgQFJcJHt/kw
+ps8D5YULj/MVMLlsPtXDdZmbOi/G9pN0tr05MKcXsO5Ywe7n2BhASw==
+=2Nzb
+-----END PGP SIGNATURE-----
+
+--nextPart3682207.KLrp2sxpbf--
diff --git a/tests/data/openpgp-signed-two-attachments.plain b/tests/data/openpgp-signed-two-attachments.plain
new file mode 100644
index 0000000..6c3403f
--- /dev/null
+++ b/tests/data/openpgp-signed-two-attachments.plain
@@ -0,0 +1 @@
+this is the main body text
diff --git a/tests/t-parser.cpp b/tests/t-parser.cpp
index bc68c5e..0c06636 100644
--- a/tests/t-parser.cpp
+++ b/tests/t-parser.cpp
@@ -50,6 +50,18 @@ struct
     NULL,
     0,
     "iso-8859-1"},
+  { DATADIR "/openpgp-signed-no-attach-gpgol.mbox",
+    MSGTYPE_GPGOL_MULTIPART_SIGNED,
+    DATADIR "/openpgp-signed-no-attach-gpgol.plain",
+    NULL,
+    0,
+    "iso-8859-1"},
+  { DATADIR "/openpgp-signed-two-attachments.mbox",
+    MSGTYPE_GPGOL_MULTIPART_SIGNED,
+    DATADIR "/openpgp-signed-two-attachments.plain",
+    NULL,
+    2,
+    "us-ascii"},
   { DATADIR "/openpgp-encrypted+signed.mbox",
     MSGTYPE_GPGOL_MULTIPART_ENCRYPTED,
     DATADIR "/openpgp-encrypted+signed.plain",

commit 4d3b317569e3637692f7f925064cccf31d6671f9
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed Oct 12 10:35:50 2016 +0200

    Change behavior of inline attachments
    
    * src/mimedataprovider.cpp (t2body): Treat inline attachments
    as attachments.
    
    --
    The old parser added inline attachments to the body. Outlook
    by default shows inline attachments just as attachments. I also
    think this is better then just adding them in the body.

diff --git a/src/mimedataprovider.cpp b/src/mimedataprovider.cpp
index a4aea43..e5dbe8f 100644
--- a/src/mimedataprovider.cpp
+++ b/src/mimedataprovider.cpp
@@ -158,7 +158,11 @@ is_cms_signed_data (const char *buffer, size_t length)
 /* Process the transition to body event.
 
    This means we have received the empty line indicating the body and
-   should now check the headers to see what to do about this part.  */
+   should now check the headers to see what to do about this part.
+
+   This is mostly a C style function because it was based on the old
+   c mimeparser.
+*/
 static int
 t2body (MimeDataProvider *provider, rfc822parse_t msg)
 {
@@ -169,7 +173,7 @@ t2body (MimeDataProvider *provider, rfc822parse_t msg)
   size_t off;
   char *p;
   int is_text = 0;
-  int not_inline_text = 0;
+  int is_text_attachment = 0;
   char *filename = NULL;
   char *charset = NULL;
 
@@ -197,8 +201,21 @@ t2body (MimeDataProvider *provider, rfc822parse_t msg)
       if (s)
         filename = rfc2047_parse (s);
       s = rfc822parse_query_parameter (field, NULL, 1);
-      if (s && strcmp (s, "inline"))
-        not_inline_text = 1;
+
+      /* This is a bit of a taste matter how to treat inline
+         attachments. Outlook does not show them inline so we
+         should not put it in the body either as we have
+         no way to show that it was actually an attachment.
+         For something like an inline patch it is better
+         to add it as an attachment instead of just putting
+         it in the body.
+
+         The handling in the old parser was:
+
+         if (s && strcmp (s, "inline"))
+           not_inline_text = 1;
+       */
+      is_text_attachment = 1;
       rfc822parse_release_field (field);
     }
 
@@ -325,16 +342,16 @@ t2body (MimeDataProvider *provider, rfc822parse_t msg)
   ctx->in_data = 1;
 
   log_mime_parser ("%s:%s: this body: nesting=%d partno=%d is_text=%d"
-                   " charset=\"%s\"\n body_seen=%d not_inline_text=%d",
+                   " charset=\"%s\"\n body_seen=%d is_text_attachment=%d",
                    SRCNAME, __func__,
                    ctx->nesting_level, ctx->part_counter, is_text,
                    ctx->mimestruct_cur->charset?ctx->mimestruct_cur->charset:"",
-                   ctx->body_seen, not_inline_text);
+                   ctx->body_seen, is_text_attachment);
 
   /* If this is a text part, decide whether we treat it as one
      of our bodies.
      */
-  if ((is_text && !not_inline_text))
+  if ((is_text && !is_text_attachment))
     {
       if (is_text == 2)
         {

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

Summary of changes:
 src/mimedataprovider.cpp                           | 31 ++++++++++---
 ...ch.mbox => openpgp-signed-no-attach-gpgol.mbox} |  9 ----
 ....plain => openpgp-signed-no-attach-gpgol.plain} |  0
 tests/data/openpgp-signed-two-attachments.mbox     | 54 ++++++++++++++++++++++
 tests/data/openpgp-signed-two-attachments.plain    |  1 +
 tests/t-parser.cpp                                 | 12 +++++
 6 files changed, 91 insertions(+), 16 deletions(-)
 copy tests/data/{openpgp-signed-no-attach.mbox => openpgp-signed-no-attach-gpgol.mbox} (75%)
 copy tests/data/{openpgp-signed-no-attach.plain => openpgp-signed-no-attach-gpgol.plain} (100%)
 create mode 100644 tests/data/openpgp-signed-two-attachments.mbox
 create mode 100644 tests/data/openpgp-signed-two-attachments.plain


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




More information about the Gnupg-commits mailing list