If, like me, you run KMail trunk (what will be 4.2), sign your emails and don’t use gpg-agent, you may have found that signing emails suddenly stopped working a while back. I finally traced the problem: a change in the way signing is done with the gpgme backend means that kleo, the magic behind all things cryptographic in kdepim, no longer provides a password entry dialog. The reason is that the signing is done in a side thread, and GUI stuff can only be done in the main thread.
The solution? Use gpg-agent, of course. You need to install gpg-agent and the pinentry package, and then put a script (call it gpg-agent.sh – the .sh is important) in $KDEHOME/env that starts gpg-agent. The contents of my ~/.kde/env/gpg-agent.sh file are simply:
eval $(gpg-agent --daemon --pinentry-program /usr/bin/pinentry-qt)
You should also stop it again at logout. To do this put the following script in the $KDEHOME/shutdown folder and make it executable:
!/bin/sh
# the second field of the GPG_AGENT_INFO variable is the
# process ID of the gpg-agent active in the current session
# so we'll just kill that, rather than all of them
[ -n "${GPG_AGENT_INFO}" ] &&
kill $(echo "${GPG_AGENT_INFO}" | cut -d ':' -f 2)
All this stolen from a Gentoo HOWTO.
26th July 2008 at 12:38 am |
Thank you very much! This just made my day! I have been at a loss trying to figure out how to get my e-mails signed using KMail (in 4.1). Thank you again! 🙂
8th October 2008 at 7:29 am |
but it don’t working for me! 😦
i’m using kmail 1.10.1 on KDE 4.1.2 on Kubuntu
12th October 2008 at 4:57 am |
🙂 it works…
12th October 2008 at 5:09 am |
[…] مطلب از اینجا دزدیده […]
17th February 2009 at 1:14 pm |
Thanks, it works!
You just forgot to mention that gpg-agent.sh should also be made executable. 😉
18th October 2009 at 2:36 pm |
Great workaround, however it was not working out of the box for me on archlinux with kdemod 4.3 and kmail 1.12.2. The reason was qt3 was missing. After installing qt3 it works.
So if this workaround is not working for you I suggest to start pinentry-qt from a terminal and look at the output. If something like “error while loading shared libraries: libqt-mt.so.3: cannot open shared object file: No such file or directory” shows up it is likely that qt3 is missing.
30th March 2012 at 9:18 am |
[…] https://randomguy3.wordpress.com/2008/07/24/kmail-trunk-signing/ […]
24th October 2012 at 7:22 am |
[…] Para que puedas enviar los correos firmados en kmail: https://randomguy3.wordpress.com/2008/07/24/kmail-trunk-signing/ […]