Bug 93916

Summary: OpenPGP/MIME signing fails with drag-and-drop 8-bit attachments (in any encoding)
Product: [Applications] kmail Reporter: Tristan Miller <psychonaut>
Component: encryptionAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED WORKSFORME    
Severity: normal CC: jtamate, lemma
Priority: NOR Keywords: triaged
Version: 1.5.1   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: An iso-8859-1-encoded e-mail message (to be attached to other messages)
E-mail with a correctly signed file attachment
E-mail with incorrect drag-and-drop 8-bit attachment
E-mail with incorrect drag-and-drop quoted-printable attachment
E-mail with incorrect drag-and-drop Base64 attachment
Screenshot showing Attachment 8434 being viewed in KMail

Description Tristan Miller 2004-11-25 19:28:52 UTC
Version:            (using KDE KDE 3.3.1)
Installed from:    SuSE RPMs

It is impossible to attach a message to another message via drag-and-drop and have that attachment signed via PGP/GnuPG.  The resulting message always has a bad signature.  This happens whether the encoding selected is 8-bit, Base64, or quoted-printable.

Steps to reproduce:

0) Set up KMail to work with GnuPG.
1) Message->New Message
2) Fill in header fields as required
3) From the main KMail window, drag a message containing 8-bit characters to the compose window.  It now shows up as an attachment in a subpane.
4) If desired, right-click on the attachment, select Properties, and select either 8-bit, Base64, or Quoted-printable as the encoding.
5) Make sure the message and attachment are to be cryptographically signed (Options->Sign Message) and formatted via OpenPGP/MIME (Options>Cryptographic Message Format->OpenPGP/Mime) using a valid key
6) Message->Send Now
7) View the message you just sent in your sent-mail folder.  Even though you signed it with your own key, KMail claims the signature is bad. (See screenshot attachment.)

There is either some interoperability issues with GnuPG, or KMail is modifying the message after it is signed, or both.

This problem occurs only with drag-and-drop attachments.  If I save an e-mail message to a file and then attach it via Attach->Attach File, then the PGP signature is valid.

I am attaching a sample e-mail message, plus several signed e-mails attaching this message.
Comment 1 Tristan Miller 2004-11-25 19:30:02 UTC
Created attachment 8430 [details]
An iso-8859-1-encoded e-mail message (to be attached to other messages)
Comment 2 Tristan Miller 2004-11-25 19:32:05 UTC
Created attachment 8431 [details]
E-mail with a correctly signed file attachment

This e-mail contains Attachment 8430 [details] as a signed attachment.  It was produced
via Attach->Attach File.  The signature is valid.
Comment 3 Tristan Miller 2004-11-25 19:33:55 UTC
Created attachment 8432 [details]
E-mail with incorrect drag-and-drop 8-bit attachment

This is an e-mail message containing Attachment 8430 [details] as an unencoded 8-bit
attachment.  This attachment was produced via drag-and-drop.  The signature is
invalid.
Comment 4 Tristan Miller 2004-11-25 19:34:54 UTC
Created attachment 8433 [details]
E-mail with incorrect drag-and-drop quoted-printable attachment

This is an e-mail message containing Attachment 8430 [details] as a quoted-printable
attachment.  This attachment was produced via drag-and-drop.  The signature is
invalid.
Comment 5 Tristan Miller 2004-11-25 19:35:33 UTC
Created attachment 8434 [details]
E-mail with incorrect drag-and-drop Base64 attachment

This is an e-mail message containing Attachment 8430 [details] as a base64-encoded
attachment.  This attachment was produced via drag-and-drop.  The signature is
invalid.
Comment 6 Tristan Miller 2004-11-25 19:37:31 UTC
Created attachment 8435 [details]
Screenshot showing Attachment 8434 [details] being viewed in KMail
Comment 7 Tristan Miller 2004-11-25 19:42:52 UTC
I should also point out that the attachment as displayed by KMail in Attachment 8434 [details] seems to be mangled... the fancy From/To/Subject box contains no header information.  There is a similar problem with 8-bit and quoted-printable drag-and-drop attachments.  Let me know if you want a screenshot of those too.
Comment 8 Tristan Miller 2005-04-30 21:51:51 UTC
Confirming bug still exists in KDE 3.4.
Comment 9 Dominik Tritscher 2008-09-14 17:50:08 UTC
This seems to work with KDE4 using kmail from trunk r860647.
Comment 10 Jaime Torres 2008-09-16 20:02:56 UTC
it works for me also in trunk.