Bug 289722 - Incorrect Content-Transfer-Encoding header value is set for openpgp/mime encrypted mails
Summary: Incorrect Content-Transfer-Encoding header value is set for openpgp/mime encr...
Alias: None
Product: kmail2
Classification: Unclassified
Component: crypto (show other bugs)
Version: 4.9.2
Platform: Ubuntu Packages Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: kdepim bugs
: 109229 263155 (view as bug list)
Depends on:
Reported: 2011-12-24 09:49 UTC by Stanislav Sidorenko
Modified: 2015-01-29 18:46 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.10.2

Proposed patch (483 bytes, application/octet-stream)
2012-06-04 19:07 UTC, Stanislav Sidorenko

Note You need to log in before you can comment on or make changes to this bug.
Description Stanislav Sidorenko 2011-12-24 09:49:37 UTC
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="nextPart5141910.e6Y767UtIz"; protocol="application/pgp-encrypted"
Content-Transfer-Encoding: base64 

Content-Type: application/pgp-encrypted
Content-Disposition: attachment

Version: 1
Content-Type: application/octet-stream
Content-Disposition: inline; filename="msg.asc"

Version: GnuPG v1.4.11 (GNU/Linux)


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. "Тестовое сообщение".
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.
Comment 1 Christophe Giboudeaux 2012-01-08 10:33:05 UTC

*** This bug has been marked as a duplicate of bug 289728 ***
Comment 2 Stanislav Sidorenko 2012-06-04 19:05:22 UTC
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.
Comment 3 Stanislav Sidorenko 2012-06-04 19:07:31 UTC
Created attachment 71583 [details]
Proposed patch

This fixes this bug for me, but I'm not sure about potential regressions. And it does not fix bug 289728.
Comment 4 Sandro Knauß 2013-03-03 21:14:58 UTC

A Patch is now in review that should fix this bug:
Comment 5 Sandro Knauß 2013-03-06 22:13:48 UTC
Git commit 597f7a5f56061d0107b3264b6453cf7b09cbfc6a by Sandro Knauß.
Committed on 03/03/2013 at 19:50.
Pushed by knauss into branch 'KDE/4.10'.

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

M  +31   -7    messagecomposer/util.cpp

Comment 6 Sandro Knauß 2013-03-28 09:01:25 UTC
*** Bug 296629 has been marked as a duplicate of this bug. ***
Comment 7 Sandro Knauß 2013-11-08 14:36:16 UTC
*** Bug 109229 has been marked as a duplicate of this bug. ***
Comment 8 Sandro Knauß 2013-11-08 14:37:06 UTC
*** Bug 263155 has been marked as a duplicate of this bug. ***
Comment 9 Dennis Schridde 2015-01-22 08:26:03 UTC
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

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="nextPart1643101.pK0q01Qtpq"; micalg="pgp-sha1"; protocol="application/pgp-signature"

Content-Type: multipart/mixed; boundary="nextPart1991752.9pWY7iA1iV"
Content-Transfer-Encoding: quoted-printable

This is a multi-part message in MIME format.

My original problem description can be found in bug #296629.
Comment 10 Dennis Schridde 2015-01-22 08:32:49 UTC
P.S: This message also has two 500KiB PDF attachments:

Content-Disposition: attachment; filename="[…].pdf"
Content-Transfer-Encoding: base64
Content-Type: application/pdf; name="[…].pdf"
Comment 11 Dennis Schridde 2015-01-29 18:46:11 UTC
Just ran into this again. Please reopen.