Bug 356093 - Kmail does not display PGP/Inline signed mails
Summary: Kmail does not display PGP/Inline signed mails
Status: RESOLVED FIXED
Alias: None
Product: kdepim
Classification: Applications
Component: general (show other bugs)
Version: GIT (master)
Platform: Arch Linux Linux
: NOR major
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-29 21:53 UTC by Marcus Behrendt
Modified: 2015-12-22 00:52 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 15.12.1


Attachments
kwatchgnupg.log (123.44 KB, text/plain)
2015-12-18 10:57 UTC, Martin Steigerwald
Details
example mail from debian-devel-changes-ml I used for creating kwatchgnupg log (6.96 KB, text/plain)
2015-12-18 10:58 UTC, Martin Steigerwald
Details
gpg.conf I used for previous test (3.38 KB, text/plain)
2015-12-18 11:43 UTC, Martin Steigerwald
Details
dirmngr.conf used for previous test (301 bytes, text/plain)
2015-12-18 11:48 UTC, Martin Steigerwald
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Behrendt 2015-11-29 21:53:26 UTC
I am using kde-unstable/kmail 15.11.80-2 from Arch Linux.
With this new version I am not able to view PGP/Inline signed mails any more.
The mail is just empty and kmail's cpu usage is very high.




Reproducible: Always

Steps to Reproduce:
1. Receive a PGP/Inline signed mail
2. Try to open that mail with kmail

Actual Results:  
The received mail is just empty and kmail's cpu usage is high

Expected Results:  
I can read the mail
Comment 1 Adrian Piotrowicz 2015-12-18 09:49:32 UTC
Do you have enabled option "Attempt decryption of encrypted messages when viewing" under "Security" -> "Reading" in KMail settings?
I do not have high CPU usage but I have no mail body and no information about body being encrypted without that option enabled.
Comment 2 Laurent Montel 2015-12-18 10:27:13 UTC
I cc 	Sandro Knauß which changed some code in messageview about it.
Comment 3 Martin Steigerwald 2015-12-18 10:53:29 UTC
I have this as well with KF5, Akonadi, KDEPIM compiled from Git master as of yesterday. I have it since quite some time already. Basically it fires up gpg again and again. I attach gnupg log and a mail which triggers the issue.
Comment 4 Martin Steigerwald 2015-12-18 10:57:40 UTC
Created attachment 96160 [details]
kwatchgnupg.log

It basically restarts gnupg again and again and again as it can´t verify the signature.

Adrian, I do not find the setting for automatically checking signatures. It is enabled here, I want to disable it, until this bug is fixed.
Comment 5 Martin Steigerwald 2015-12-18 10:58:26 UTC
Created attachment 96161 [details]
example mail from debian-devel-changes-ml I used for creating kwatchgnupg log
Comment 6 Sandro Knauß 2015-12-18 11:09:26 UTC
what about gpg.conf, dirmgr.conf? gnugpg changed behaviour in the last releases / what version is installed?

Are all signed mails broken or only some parts of it?

Martin, Adrian is taking about auto decryption - I also didn't found something to disable the verification
Comment 7 Adrian Piotrowicz 2015-12-18 11:18:01 UTC
I do not have a problem described in this report.
I can read both signed and encrypted messages (almost) without problem.
For me it's a problem with lack of information that the message is encrypted if auto decryption is turned off. It's a different issue.
I thought that maybe it's just lack of indication about message being signed/encrypted and connected it with my issue.
Comment 8 Marcus Behrendt 2015-12-18 11:41:26 UTC
(In reply to Sandro Knauß from comment #6)
> what about gpg.conf, dirmgr.conf? gnugpg changed behaviour in the last
> releases / what version is installed?
> 
> Are all signed mails broken or only some parts of it?
> 
> Martin, Adrian is taking about auto decryption - I also didn't found
> something to disable the verification

I also thought that may be the cause. But downgrading kmail to 4.14.10 solved my problem.
The problem was not present in the 15.08.x release. And as mentioned before only affects PGP/Inline signed/encrypted mails. PGP/Mime still works. I will post kmail's stdout this evening and hope there might be something useful in it.
Comment 9 Martin Steigerwald 2015-12-18 11:43:51 UTC
Created attachment 96167 [details]
gpg.conf I used for previous test

may it stumble over keyid-format 0xlong

The config is a recommendation from they example gpg.conf linked onhttps://people.debian.org/~anibal/ksp-dc15/ksp-dc15.html under "Check your key and fix any problem with your key"
Comment 10 Martin Steigerwald 2015-12-18 11:48:19 UTC
Created attachment 96168 [details]
dirmngr.conf used for previous test

gnugp is from Debian Sid packages – I don´t know which one KMail is running:

martin@merkaba:~> apt-show-versions | grep "^gnupg"
gnupg:amd64/sid 1.4.19-6 uptodate
gnupg:i386 not installed
gnupg-agent:amd64/sid 2.1.10-3 uptodate
gnupg-agent:i386 not installed
gnupg-curl:amd64/sid 1.4.19-6 uptodate
gnupg-curl:i386 not installed
gnupg2:amd64/sid 2.1.10-3 uptodate
gnupg2:i386 not installed

martin@merkaba:~> LANG=C gpg --version
gpg: /home/martin/.gnupg/gpg.conf:98: invalid option
gpg (GnuPG) 1.4.19
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: ~/.gnupg
Supported algorithms:
Pubkey: RSA, RSA-E, RSA-S, ELG-E, DSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

martin@merkaba:~> LANG=C gpg2 --version
gpg: keyserver option 'ca-cert-file' is obsolete; please use 'hkp-cacert' in dirmngr.conf
gpg: keyserver option 'no-try-dns-srv' is unknown
gpg (GnuPG) 2.1.10
libgcrypt 1.6.4
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: ~/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2
Comment 11 Martin Steigerwald 2015-12-18 13:34:30 UTC
In a debugging session together with Sandro we found that messageviewer renders such a mail okay, but kmail does not check that it already verified the mail, the verification failed and then tries it all again. It basically loops over:

(gdb) continue
Continuing.
[Thread 0x7fbd2bbed700 (LWP 21855) exited]
[New Thread 0x7fbd2bbed700 (LWP 21859)]
[Thread 0x7fbd2bbed700 (LWP 21859) exited]
[New Thread 0x7fbd2bbed700 (LWP 21862)]
[Thread 0x7fbd2bbed700 (LWP 21862) exited]

Breakpoint 1, MessageViewer::ViewerPrivate::displayMessage (this=0x182daf0) at /home/kde/sources/messagelib/messageviewer/src/viewer/viewer_p.cpp:804
804         showHideMimeTree();
(gdb) continue
Continuing.
[New Thread 0x7fbd2bbed700 (LWP 21865)]
[Thread 0x7fbd2bbed700 (LWP 21865) exited]
[New Thread 0x7fbd2bbed700 (LWP 21868)]
[Thread 0x7fbd2bbed700 (LWP 21868) exited]

Breakpoint 1, MessageViewer::ViewerPrivate::displayMessage (this=0x182daf0) at /home/kde/sources/messagelib/messageviewer/src/viewer/viewer_p.cpp:804
804         showHideMimeTree();
(gdb) continue
Continuing.
[New Thread 0x7fbd2bbed700 (LWP 21873)]
[Thread 0x7fbd2bbed700 (LWP 21873) exited]
[New Thread 0x7fbd2bbed700 (LWP 21876)]
[Thread 0x7fbd2bbed700 (LWP 21876) exited]

Breakpoint 1, MessageViewer::ViewerPrivate::displayMessage (this=0x182daf0) at /home/kde/sources/messagelib/messageviewer/src/viewer/viewer_p.cpp:804
804         showHideMimeTree();

Sandro is working on a fix I will test then. Thanks, Martin
Comment 12 Sandro Knauß 2015-12-22 00:52:34 UTC
Git commit d3fcd2a4790cbe261181ddea29392178fb2e0dbb by Sandro Knauß.
Committed on 22/12/2015 at 00:44.
Pushed by knauss into branch 'master'.

Don't endup in a endless loop for inline signed messages

For inline signed messages the reference node is a null pointer
so we also need to set the memento for this null sign pointer, to
be able to refind the memento again.

This patch makes it impossible to have multiple inline signed messages blocks.
But one the other side it wasn't working before, too :)
REVIEW: 126451

M  +25   -0    messageviewer/autotests/objecttreeparsertest.cpp
M  +1    -0    messageviewer/autotests/objecttreeparsertest.h
M  +1    -3    messageviewer/src/viewer/objecttreeparser.cpp

http://commits.kde.org/messagelib/d3fcd2a4790cbe261181ddea29392178fb2e0dbb