Bug 286481 - Unable to open attachments in encrypted messages
Summary: Unable to open attachments in encrypted messages
Status: RESOLVED FIXED
Alias: None
Product: kmail2
Classification: Applications
Component: general (show other bugs)
Version: 4.11
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 294272 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-11-13 11:52 UTC by Jannis Menn
Modified: 2013-10-29 10:26 UTC (History)
14 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.11.3
Sentry Crash Report:


Attachments
mail with not clickable link (19.62 KB, image/png)
2013-10-25 09:02 UTC, Till Schäfer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jannis Menn 2011-11-13 11:52:14 UTC
Version:           4.7 (using KDE 4.7.2) 
OS:                Linux

When I receive a pgp-encrypted message with an attachment, I am unable to open the attachment. The attached file is displayed, but clicking on it does not have any effect. Right-clicking on the mail and selecting "save attachments" results in kmail2 to save the whole mail as an .asc-file.

Reproducible: Always

Steps to Reproduce:
Open any pgp-encrypted e-mail with an attachment in it. Click on the attachment.

Actual Results:  
Nothing happens.

Expected Results:  
Open a dialog to save the file.
Comment 1 Laurent Montel 2011-11-13 17:07:28 UTC
Will look at it in master.
Comment 2 Laurent Montel 2011-11-13 17:15:25 UTC
Question: How we create an email pgp encrypted email .?
Comment 3 Laurent Montel 2011-11-15 10:35:23 UTC
no infos ?
Comment 4 Jannis Menn 2011-11-15 18:35:36 UTC
Hello... what info do you need exactly? How to create an encrypted message is easy: just create a key-pair (f.e. with kleopatra), link the keys to your identity in kmail-settings, create a mail, select "encrypt" and send it to yourself.
Comment 5 Laurent Montel 2011-11-16 20:56:52 UTC
I can't reproduce in master.
But I fixed a lot of bug. (backported to 4.7.3/4.7.4) So perhaps you can test on new version.
Regards.
Comment 6 Jannis Menn 2011-11-16 23:18:28 UTC
Ok, i'll try that, thanks.
Comment 7 Michael S. 2011-12-08 13:26:33 UTC
The bug still exists in kde 4.7.4.
Comment 8 Tim 2012-09-16 18:08:41 UTC
The bug still exists in kde 4.8.4.
Comment 9 Myriam Schweingruber 2012-09-17 09:41:38 UTC
Reopening based on comments #7 and #8
Comment 10 quazgar 2012-09-26 18:46:42 UTC
I can confirm this or a similar bug, at least for some mails.

The attachment is only shown as a link, e.g. "attachment:0:2?place=body", and can ony be saved as a link to this location.

I cannot give a recipe how to reproduce this kind of problematic email, it only happens sometimes to me.

A workaround: Save the encrypted email to disk, decrypt manually, save result as foo.mbox, open that in Kmail and save the attachment from the unencrypted email.
Comment 11 Ivan Shapovalov 2013-06-30 14:26:45 UTC
The bug still exists in KDE SC 4.10.4. Problematic E-mails sent from Windows using Thunderbird with Enigmail extension.
Comment 12 Sandro Knauß 2013-08-02 21:44:54 UTC
Can you tell me more about the structure of the mail, where the link doesn't work:
* Is this a openpgp/MIME or inlnie message
* Are the hole message is encrypted at once or the attachments  sperately?
Comment 13 quazgar 2013-08-02 22:11:32 UTC
(In reply to comment #12)
> Can you tell me more about the structure of the mail, where the link doesn't
> work:
> * Is this a openpgp/MIME or inlnie message
> * Are the hole message is encrypted at once or the attachments  sperately?

I can send a sample to you personally for the full headers, but this looks like the relevant information:

....
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1
MIME-Version: 1.0
....
X-Enigmail-Version: 1.3.3
Content-Type: multipart/encrypted;
  protocol="application/pgp-encrypted";
  boundary="------------enigXXXXXX"
....

This is an OpenPGP/MIME encrypted message (RFC 2440 and 3156)
--------------enigXXXXXX
Content-Type: application/pgp-encrypted
Content-Description: PGP/MIME version identification

Version: 1

--------------enigXXXXXX
Content-Type: application/octet-stream; name="encrypted.asc"
Content-Description: OpenPGP encrypted message
Content-Disposition: inline; filename="encrypted.asc"

-----BEGIN PGP MESSAGE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
Comment 14 Sandro Knauß 2013-08-05 00:09:06 UTC
Have now one message, to play with and can confirm this bug with KDE 4.11 branch.

As I can tell till now, the structure, that objectparser creates looks correct (also the links to the attachments). I think the error is located in the funtion, that resolves the links.

It is an PGP Mime Message with folloing structure inside:

Content-Type: multipart/mixed;
 boundary="------------030502030301040002020205"

This is a multi-part message in MIME format.
--------------030502030301040002020205
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: quoted-printable

blabla...

--------------030502030301040002020205
Content-Type: text/plain; charset=windows-1252;
 name="testfile"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename="testfile"

Some testfile

--------------030502030301040002020205--
Comment 15 Sandro Knauß 2013-08-05 07:49:53 UTC
*** Bug 294272 has been marked as a duplicate of this bug. ***
Comment 16 Sandro Knauß 2013-10-19 21:23:30 UTC
*** Bug 324365 has been marked as a duplicate of this bug. ***
Comment 17 Sandro Knauß 2013-10-21 16:50:12 UTC
Git commit bbbdbc2180036040cac2b66492e6f0fd01c2b28c by Sandro Knauß.
Committed on 21/10/2013 at 00:47.
Pushed by knauss into branch 'KDE/4.11'.

Fix 286481 - Unable to open attachments in encrypted messages

The node has to get a correct extra content and the filename must be
correctly point to the attachments inside the encrypted message.
Related: bug 300937
FIXED-IN: 4.11.3
REVIEW: 113361

M  +2    -3    messageviewer/viewer/nodehelper.cpp
M  +1    -1    messageviewer/viewer/objecttreeparser.cpp

http://commits.kde.org/kdepim/bbbdbc2180036040cac2b66492e6f0fd01c2b28c
Comment 18 Till Schäfer 2013-10-25 09:01:43 UTC
this bug is NOT solved for me. i have a pgp/mime mail which is signed and encrypted and still has the problem that the file is not savable. if i right click on the file, the normal context menu is shown, that i can see if i click anywhere in a mail. 


Content-Type: multipart/encrypted; protocol="application/pgp-encrypted";
 micalg="pgp-sha1"; boundary="===============8454854918288420383=="
MIME-Version: 1.0
From: XXXXXXXX
To: till2.schaefer@tu-dortmund.de
Date: Thu, 24 Oct 2013 17:03:34 -0400
Subject: Your signed PGP key 0xD84DED79

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============8454854918288420383==
Content-Type: application/pgp-encrypted
Content-Description: PGP/MIME version identification

Version: 1

--===============8454854918288420383==
Content-Type: application/octet-stream; name="encrypted.asc"
Content-Description: OpenPGP encrypted message
Content-Disposition: inline; filename="encrypted.asc"

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

...encrypted stuff...

-----END PGP MESSAGE-----

--===============8454854918288420383==--
Comment 19 Till Schäfer 2013-10-25 09:02:38 UTC
Created attachment 83102 [details]
mail with not clickable link
Comment 20 Till Schäfer 2013-10-25 09:04:06 UTC
Forget to mention, that iam using the latest gentoo ebuild (kde-base/kmail-4.11.2-r1). The changelog states, that this patch was backported.
Comment 21 Andreas K. Huettel 2013-10-25 09:43:49 UTC
Hey Till, yes I did indeed add this commit. Please make sure that you re-started everything relevant... it would be best if you log out and log back in again!
Comment 22 Till Schäfer 2013-10-25 10:07:22 UTC
Hi Andreas, i already did a reboot. Still not working.
Comment 23 Matt Whitlock 2013-10-25 14:03:14 UTC
Just a note: to get some changes to the KMail sources to take effect in Gentoo, you also need to rebuild kdepimlibs.
Comment 24 Till Schäfer 2013-10-25 14:39:13 UTC
rebuilding kdepimlibs did not change the behavior. should i file a gentoo bug for this or is this? I don't know if it is gentoo specific.
Comment 25 Till Schäfer 2013-10-27 21:43:42 UTC
i have noticed that the bug only occurs, when the mail is signed AND encrypted. All mails that are only encrypted are working. When i have a signed and encrypted mail, the attachement name shown on the top of the mail is called encrypted.asc and not <attached file name>. for encrypted mails (not signed) this line states the attached file name. so maybe this obversations are somewhat connected?
Comment 26 Sandro Knauß 2013-10-29 00:41:53 UTC
(In reply to comment #25)
> i have noticed that the bug only occurs, when the mail is signed AND
> encrypted. All mails that are only encrypted are working. When i have a
> signed and encrypted mail, the attachement name shown on the top of the mail
> is called encrypted.asc and not <attached file name>. for encrypted mails
> (not signed) this line states the attached file name. so maybe this
> obversations are somewhat connected?

Actually this is exactly the bug that was solved. It sounds for me, that the patch was NOT included in the version you have used. Plaese look into your code, that you compile, to make sure that the pach is added (only three lines patch).
Comment 27 Andreas K. Huettel 2013-10-29 08:50:51 UTC
(In reply to comment #26)
> (In reply to comment #25)
> > i have noticed that the bug only occurs, when the mail is signed AND
> > encrypted. All mails that are only encrypted are working. When i have a
> > signed and encrypted mail, the attachement name shown on the top of the mail
> > is called encrypted.asc and not <attached file name>. for encrypted mails
> > (not signed) this line states the attached file name. so maybe this
> > obversations are somewhat connected?
> 
> Actually this is exactly the bug that was solved. It sounds for me, that the
> patch was NOT included in the version you have used. Plaese look into your
> code, that you compile, to make sure that the pach is added (only three
> lines patch).

My fault. Till please also upgrade to kdepim-common-libs-4.11.2-r1. I applied the patch in the wrong part of our split kdepim; it got happily applied but never compiled. 

(side note, if you need help in splitting kdepim into different repositories, have a look at our ebuilds :)
Comment 28 Till Schäfer 2013-10-29 10:26:07 UTC
Now it is working for me. Therefore this was a gentoo bug.