Bug 305171 - PGP/MIME signatures are invalid when text/plain; charset="us-ascii" is used
Summary: PGP/MIME signatures are invalid when text/plain; charset="us-ascii" is used
Status: RESOLVED WAITINGFORINFO
Alias: None
Product: kmail2
Classification: Applications
Component: crypto (show other bugs)
Version: 4.7
Platform: openSUSE Linux
: NOR major
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-15 00:06 UTC by Hauke Laging
Modified: 2014-01-04 05:17 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
mail with bad signature, saved from Thunderbird to a file (7.53 KB, message/rfc822)
2013-04-12 23:53 UTC, Hauke Laging
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hauke Laging 2012-08-15 00:06:39 UTC
Since KMail2 nearly all (more than 90%) of my email signatures are shown as invalid by other mail clients. I tried to understand which software is buggy by reading the rfc but I am still not sure. Most probably it is KMail2. KMail2 shows these signatures as correct.

The problem seems to be a missing newline. The MIME seperator is placed directly after my last signature line:

########################
PGP: D44C 6A5B 71B0 427C CED3 025C BD7D 6D27 ECCB 5814
--nextPart20694277.1dnrQtI15C
########################

In earlier versions of KMail (and in Thunderbird) there was en empty line in between:
########################
PGP: D44C 6A5B 71B0 427C CED3 025C BD7D 6D27 ECCB 5814

--nextPart3343035.S6mqRQsH14
########################

The signature is not completely wrong. If I save the mail as a file, convert it to DOS newline and add a newline to the end of the data block then I can verify the signature by gpg. So it is obvously just a formatting problem.

It seems not to make a difference whether the signature text ends with a newline.

Reproducible: Always

Steps to Reproduce:
1. Just send a signed email in PGP/MIME format.

Actual Results:  
Signature is not recognized by other mail clients.

Expected Results:  
A compatible signature (or rather: compatible MIME formatting of it).
Comment 1 Laurent Montel 2012-08-15 10:57:22 UTC
Sorry I can't success to test it.
How do you create PGP/MIME ?

I never success to have line as 
"########################
 PGP:
...
"
So I don't know how to configure/test it
Comment 2 Hauke Laging 2012-08-16 01:38:39 UTC
Embarrassing... but I have to correct some of my statements and guesses.

Meanwhile I have found the difference between the emails with valid signatures and those with invalid ones:

Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"

That's the problem. All emails with this encoding have invalid signatures. The problem has nothing to do with the newlines.

The sometimes "missing" newlines between the text signature and the MIME seperator are due to different identities I used for composing the emails. Of the two text signatures of those identities only one had a trailing newline. This effect was due to the change from KMail to KMail2 (because KMail2 killed the KMail configuration and I forgot the newline when restoring the identities manually).

Both identities (with and without trailing newline) can create valid and invalid signatures. That just depends on it whether non-ASCII characters occur in the message.
Comment 3 Myriam Schweingruber 2012-08-18 09:10:00 UTC
Hauke: which exact Kmail version is this about? Please set the version field.
Comment 4 Hauke Laging 2012-08-18 13:05:53 UTC
(In reply to comment #3)
> Hauke: which exact Kmail version is this about? Please set the version field.

It is 4.7.2 (the current openSUSE version). Now I can set 4.7. Funny, IIRC that value was not available when I opened the bug.
Comment 5 Sandro Knauß 2013-04-12 23:10:13 UTC
Can you give a text, that you entered into kmail, that has an invalid signature?
Can you pease give kmail 4.10.2 a try? There are some improments with CTE entered kmail.
Comment 6 Hauke Laging 2013-04-12 23:53:06 UTC
Created attachment 78849 [details]
mail with bad signature, saved from Thunderbird to a file

For reproducing the bug.
Comment 7 Hauke Laging 2013-04-12 23:55:17 UTC
(In reply to comment #5)
> Can you give a text, that you entered into kmail, that has an invalid
> signature?

I attach a mail I sent which is shown as badly signed in Thunderbird.

> Can you pease give kmail 4.10.2 a try? There are some improments with CTE
> entered kmail.

I just noticed that it seems to work in KMail/4.8.5 already. At least it's shown correctly by Thunderbird/Enigmail (which shows older mails as badly signed).
Comment 8 Hauke Laging 2014-01-04 05:17:35 UTC
Has been fixed (I don't know in which version, though).