<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>289722</bug_id>
          
          <creation_ts>2011-12-24 09:49:37 +0000</creation_ts>
          <short_desc>Incorrect Content-Transfer-Encoding header value is set for openpgp/mime encrypted mails</short_desc>
          <delta_ts>2015-01-29 18:46:11 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kmail2</product>
          <component>crypto</component>
          <version>4.9.2</version>
          <rep_platform>Ubuntu</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Stanislav Sidorenko">mail</reporter>
          <assigned_to name="kdepim bugs">pim-bugs-null</assigned_to>
          <cc>arpad.kunszt</cc>
    
    <cc>bugs</cc>
    
    <cc>gentoo</cc>
    
    <cc>heri+kde</cc>
    
    <cc>mail</cc>
    
    <cc>rdieter</cc>
    
    <cc>saschpe</cc>
    
    <cc>sknauss</cc>
          
          <cf_commitlink>http://commits.kde.org/kdepim/597f7a5f56061d0107b3264b6453cf7b09cbfc6a</cf_commitlink>
          <cf_versionfixedin>4.10.2</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1204478</commentid>
    <comment_count>0</comment_count>
    <who name="Stanislav Sidorenko">mail</who>
    <bug_when>2011-12-24 09:49:37 +0000</bug_when>
    <thetext>Version:           4.7 (using KDE 4.7.3) 
OS:                Linux

If you try to send encrypted pgp/mime email that contain 8bit characters then main Content-Transfer-Encoding header will be set to base64, but it shoud contain 7Bit in this case. 

Here is a part of problematic message:

----------------------------------
MIME-Version: 1.0
Content-Type: multipart/encrypted; boundary=&quot;nextPart5141910.e6Y767UtIz&quot;; protocol=&quot;application/pgp-encrypted&quot;
Content-Transfer-Encoding: base64 


--nextPart5141910.e6Y767UtIz
Content-Type: application/pgp-encrypted
Content-Disposition: attachment

Version: 1
--nextPart5141910.e6Y767UtIz
Content-Type: application/octet-stream
Content-Disposition: inline; filename=&quot;msg.asc&quot;

-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.4.11 (GNU/Linux)

hQEMA5XFb/XflcUEAQf/XJ8D5zLDrTTXaE3MtlW4//pMc6ZH8S1bKMeQqKg8LM0U
8KnzFCoy5smyWZrMFqNmoK7CwVnfDS1AgYamVwDNPJLcYlTTqs1YCEJ2Fv/t6EtA
----------------------------------

As a result other mail client fail to decrypt and verify such mail - they try to decode base64 stream which is actually absent here.


Reproducible: Always

Steps to Reproduce:
1) Create a new message with some non 7bit characters, e.g. &quot;Тестовое сообщение&quot;.
2) Enable PGP/MIME encryption for message.
3) Put it to queue or send it.

Actual Results:  
Content-Transfer-Encoding: base64 

Expected Results:  
Content-Transfer-Encoding: 7Bit

Note, that only main(external) Content-Transfer-Encoding header should contain 7Bit, some headers are also included into encrypted stream - they are to be defined depending on actual message data.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1211358</commentid>
    <comment_count>1</comment_count>
    <who name="Christophe Marin">christophe</who>
    <bug_when>2012-01-08 10:33:05 +0000</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 289728 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1262297</commentid>
    <comment_count>2</comment_count>
    <who name="Stanislav Sidorenko">mail</who>
    <bug_when>2012-06-04 19:05:22 +0000</bug_when>
    <thetext>This is not actually duplicate of bug 289728. That bug is similar to this one, but that is about inline (deprecated) openpgp format, but this one is about newer pgp/mime format.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1262298</commentid>
    <comment_count>3</comment_count>
      <attachid>71583</attachid>
    <who name="Stanislav Sidorenko">mail</who>
    <bug_when>2012-06-04 19:07:31 +0000</bug_when>
    <thetext>Created attachment 71583
Proposed patch

This fixes this bug for me, but I&apos;m not sure about potential regressions. And it does not fix bug 289728.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1347345</commentid>
    <comment_count>4</comment_count>
    <who name="Sandro Knauß">sknauss</who>
    <bug_when>2013-03-03 21:14:58 +0000</bug_when>
    <thetext>Hey,

A Patch is now in review that should fix this bug:
https://git.reviewboard.kde.org/r/109272</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1348476</commentid>
    <comment_count>5</comment_count>
    <who name="Sandro Knauß">sknauss</who>
    <bug_when>2013-03-06 22:13:48 +0000</bug_when>
    <thetext>Git commit 597f7a5f56061d0107b3264b6453cf7b09cbfc6a by Sandro Knauß.
Committed on 03/03/2013 at 19:50.
Pushed by knauss into branch &apos;KDE/4.10&apos;.

Fixing ContentTransferEncoding for signed&amp;encrypted messages
Related: bug 289728
REVIEW: 109272
FIXED-IN: 4.10.2

M  +31   -7    messagecomposer/util.cpp

http://commits.kde.org/kdepim/597f7a5f56061d0107b3264b6453cf7b09cbfc6a</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1355102</commentid>
    <comment_count>6</comment_count>
    <who name="Sandro Knauß">sknauss</who>
    <bug_when>2013-03-28 09:01:25 +0000</bug_when>
    <thetext>*** Bug 296629 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1409877</commentid>
    <comment_count>7</comment_count>
    <who name="Sandro Knauß">sknauss</who>
    <bug_when>2013-11-08 14:36:16 +0000</bug_when>
    <thetext>*** Bug 109229 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1409879</commentid>
    <comment_count>8</comment_count>
    <who name="Sandro Knauß">sknauss</who>
    <bug_when>2013-11-08 14:37:06 +0000</bug_when>
    <thetext>*** Bug 263155 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1492904</commentid>
    <comment_count>9</comment_count>
    <who name="Dennis Schridde">heri+kde</who>
    <bug_when>2015-01-22 08:26:03 +0000</bug_when>
    <thetext>I am using KMail 4.14.2 on Ubuntu 14.04 and am still experience this issue. Please reopen.

Listserv replies:
---
Your message contains a QUOTED-PRINTABLE encoded composite MIME part, which is
not allowed by Internet standards (see  RFC2045, section 6.4, paragraph 5). In
plain English, an error in your mail program, or in a firewall or mail gateway
between your computer and LISTSERV, has caused  an error in the format of your
message.
---

Excerpt from the message returned by listserv:
---
[…]
User-Agent: KMail/4.14.2 (Linux/3.13.0-44-generic; KDE/4.14.2; x86_64; ; )
[…]
MIME-Version: 1.0
Content-Type: multipart/signed; boundary=&quot;nextPart1643101.pK0q01Qtpq&quot;; micalg=&quot;pgp-sha1&quot;; protocol=&quot;application/pgp-signature&quot;


--nextPart1643101.pK0q01Qtpq
Content-Type: multipart/mixed; boundary=&quot;nextPart1991752.9pWY7iA1iV&quot;
Content-Transfer-Encoding: quoted-printable

This is a multi-part message in MIME format.
[…]
---

My original problem description can be found in bug #296629.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1492906</commentid>
    <comment_count>10</comment_count>
    <who name="Dennis Schridde">heri+kde</who>
    <bug_when>2015-01-22 08:32:49 +0000</bug_when>
    <thetext>P.S: This message also has two 500KiB PDF attachments:

=2D-nextPart2164026.fLyKns4tNR
Content-Disposition: attachment; filename=&quot;[…].pdf&quot;
Content-Transfer-Encoding: base64
Content-Type: application/pdf; name=&quot;[…].pdf&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1495707</commentid>
    <comment_count>11</comment_count>
    <who name="Dennis Schridde">heri+kde</who>
    <bug_when>2015-01-29 18:46:11 +0000</bug_when>
    <thetext>Just ran into this again. Please reopen.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>71583</attachid>
            <date>2012-06-04 19:07:31 +0000</date>
            <delta_ts>2012-06-04 19:07:31 +0000</delta_ts>
            <desc>Proposed patch</desc>
            <filename>encrypted_content_encoding.diff</filename>
            <type>application/octet-stream</type>
            <size>483</size>
            <attacher name="Stanislav Sidorenko">mail</attacher>
            
              <data encoding="base64">LS0tIGEvbWVzc2FnZWNvbXBvc2VyL3V0aWwuY3BwCisrKyBiL21lc3NhZ2Vjb21wb3Nlci91dGls
LmNwcApAQCAtNjMsNyArNjMsNyBAQCBLTWltZTo6Q29udGVudCogTWVzc2FnZTo6VXRpbDo6Y29t
cG9zZUhlCiAgICAgaWYoICFtYWtlTXVsdGlNaW1lKCBmb3JtYXQsIHNpZ24gKSAmJiBmb3JtYXQg
JiBLbGVvOjpBbnlTTUlNRSApIHsKICAgICAgIHJlc3VsdC0+Y29udGVudFRyYW5zZmVyRW5jb2Rp
bmcoKS0+c2V0RW5jb2RpbmcoIEtNaW1lOjpIZWFkZXJzOjpDRWJhc2U2NCApOwogICAgIH0gZWxz
ZSB7Ci0gICAgICByZXN1bHQtPmNvbnRlbnRUcmFuc2ZlckVuY29kaW5nKCktPnNldEVuY29kaW5n
KCBvcmlnLT5jb250ZW50VHJhbnNmZXJFbmNvZGluZygpLT5lbmNvZGluZygpICk7CisgICAgICBy
ZXN1bHQtPmNvbnRlbnRUcmFuc2ZlckVuY29kaW5nKCktPnNldEVuY29kaW5nKCBLTWltZTo6SGVh
ZGVyczo6Q0U3Qml0ICk7CiAKICAgICB9CiAK
</data>

          </attachment>
      

    </bug>

</bugzilla>