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
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).
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?
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.)
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).
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.
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?
Maybe pinentry-qt is not installed? Anyway, this seems to be an Ubuntu-specific problem. So I'll close your bug report.
The peculiar thing is that pinentry-qt IS installed. roman@comp:~$ which pinentry-qt /usr/bin/pinentry-qt I agree with closing the bug.
Does running pinentry-qt manually (from Konsole) work? If you get the prompt enter "GETPIN". Do you get a dialog asking for your pin?
Yes, it does.
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.
Hmm, maybe there was a typo in gpg-agent.conf? Anyway, I'm glad it works now for you.
Hey, for me it helpen to change the default-key and encrypt-to in .gnupg/gpg.conf.