Bug 136042 - GPG Encryption not working properly
Summary: GPG Encryption not working properly
Status: RESOLVED WORKSFORME
Alias: None
Product: kmail
Classification: Applications
Component: encryption (show other bugs)
Version: 1.9.5
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-20 18:04 UTC by aurka
Modified: 2007-09-14 12:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description aurka 2006-10-20 18:04:52 UTC
Version:           1.9.5 (using KDE 3.5.5, Kubuntu (dapper) 4:3.5.5-0ubuntu1)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.15-27-686

I got kmail as part of Kontact, tried to follow several instructions (from the Help file, the kmail pages and from other fellow users) with different versions and suggestions, but the result is: kmail cannot encrypt messages, the only thing it succeeds in is signing messages. It asks the passphrase only for signing messages, not for encryption.

Everything else seems in order. Encryption plugins enabled, encryption outside kmail works.

Roman Dergam
Comment 1 aurka 2006-10-21 09:46:36 UTC
I tried to reinstall gnupg-agent and pinentry-qt, checked that gpg-agent is running, checked the settings (use of gpg-agent is uncommented), tried to switch gpg-agent in KGpg (which does not work, it always comes back as unswithed next time I open the tab).
Comment 2 Ingo Klöcker 2006-10-24 22:00:55 UTC
For encryption the passphrase is not needed. Only for signing and for decrypting.

What happens if you try to encrypt a message? Do you get an error message? Can you encrypt a message to yourself?
Comment 3 aurka 2006-10-24 22:15:20 UTC
When I try to send a message to myself I get (translated from Czech):

Zašifrovaná zpráva (rozšifrování není možné)
Příčina: Zásuvný modul šifrování "openpgp" nemůže dešifrovat data.

The encrypted message (decrypting is not possible)
Reason: Plug-in module for encryption "openpgp" cannot decrypt data.
Error: Bad passphrase

(Signing works OK.)
Comment 4 Ingo Klöcker 2006-10-25 00:13:45 UTC
So encryption seems to work. But decryption doesn't work. How do you start gpg-agent? The best method to do this is to put a file start-gpg-agent.sh with the following contents
========
killall gpg-agent 2>/dev/null
eval "$(gpg-agent --daemon --default-cache-ttl 36000)"
========
into the folder ~/.kde/env (if this folder doesn't exist then create it).
Comment 5 aurka 2006-10-25 20:50:55 UTC
I have a feeling that gpg-agent is started by /etc/X11/Xsession.d/90gpg-agent (Ubuntu Dapper here).

I have created the file start-gpg-agent.sh, made it executable and let's see what happens.
Comment 6 aurka 2007-02-25 19:57:38 UTC
A very strange thing happened: after trying all suggestions again I changed pinentry-qt to pinentry-x11 and it works now. This might be a Ubuntu problem, or do other distros have the same kmail-gpg issue?
Comment 7 Ingo Klöcker 2007-02-25 21:24:24 UTC
Maybe pinentry-qt is not installed?

Anyway, this seems to be an Ubuntu-specific problem. So I'll close your bug report.
Comment 8 aurka 2007-02-25 21:29:52 UTC
The peculiar thing is that pinentry-qt IS installed.

roman@comp:~$ which pinentry-qt
/usr/bin/pinentry-qt

I agree with closing the bug.
Comment 9 Ingo Klöcker 2007-02-25 23:24:33 UTC
Does running pinentry-qt manually (from Konsole) work? If you get the prompt enter "GETPIN". Do you get a dialog asking for your pin?
Comment 10 aurka 2007-02-26 09:50:32 UTC
Yes, it does.
Comment 11 aurka 2007-02-26 10:00:05 UTC
This is getting more and more peculiar. I just changed back to pinentry-qt at the gpg-agent.conf, I wanted to send the logs from KWatchGnuPG showing what the errors I encountered previously. I restarted KDE, opened Kontact and pinentry-qt suddenly works.
Comment 12 Ingo Klöcker 2007-02-26 21:35:57 UTC
Hmm, maybe there was a typo in gpg-agent.conf? Anyway, I'm glad it works now for you.
Comment 13 dionisus torimens 2007-06-24 23:42:12 UTC
Hey, for me it helpen to change the default-key and encrypt-to in .gnupg/gpg.conf.