[Kde-pim] KMail and "encrypt to self" issue

Alexis Papadopoulos iacp at free.fr
Thu Aug 23 09:31:59 BST 2007


Hello,

I'm attaching a patch which modifies cryptplug in order to set a passphrase 
callback (see gpgme_set_passphrase_cb) for when no gpg-agent is running. The 
callback code is directly taken and adapted from libkpgp which is rather nice 
since you get the same dialog when you wish to encrypt a mail (although when 
decryption DOES work, there's yet another dialog which is used, don't know 
exactly where it comes from, probably likpgp, which isn't very consistent, 
but then again, it works...).

This fixes the following issue :
_ Any encrypted mail whose PGP content is located within an 
application/pgp-encrypted Content-Type will not get decrypted if no gpg-agent 
is running. In other words, mails in your SENT folder which were encrypted 
with your private key ("never encrypt to self" must be unchecked), or 
encrypted mails you receive from other KMail clients (at least in the tests 
I've made)

I leave this to your consideration and will open a bug entry if deemed 
necessary.

Btw, Markus, could you please try and launch gpg-agent to see if this fixes 
your issues ? We most probably have the same problem (although I cannot 
explain why you're asked for a passphrase with deleted keys :S). Basically, 
do this within a terminal : 
eval `gpg-agent --daemon`
kmail

Tell us if this allows you to decrypt the mails you didn't get a dialog for 
before.

Thanks,
acp

On Thursday 23 August 2007, Markus Feilner wrote:
> Am Dienstag 21 August 2007 15:31:23 schrieb Alexis Papadopoulos:
> > On Tuesday 21 August 2007, Tom Albers wrote:
> > > One of you is getting the question for the passphrase, the other one is
> > > not. Different problems.
> >
> > My bad, I had somewhat misread his post. Although, no, we DO have a
> > omewhat similar problem. I ONLY get asked for a passphrase for mails sent
> > by others (none of my contacts are using KMail though).
> >
> > However when I choose the "encrypt to self mails" (or encrypt a mail
> > using my own key and sending it to myself, "encrypt to self" unchecked)
> > well, no passphrase is asked and I get the exact same error as Markus
> > gets...
> >
> > So the result is the same, altough the cause might actually differ
> > indeed. If Marcus could install pinentry and inform if it solved his
> > issue, that'd be great...
>
> Pinentry-qt is installed.
> BTW, I party do get a password dialog:
> The strange (or funny) behaviour is:
>
> I have tried with several keys (generated by Kgpg), including completely
> new ones. Then I sent several messages to myself. And whats happening now
> is: An old e-mail encrypted with a key deleted in Kgpg can still be
> decrypted by kmail. A password dialog pops up, and it works fine with the
> old password.
>
> However, any new key works only for encryption, where I am asked for the
> PW, but I am not asked after receiving the mail when I want to read it.
> Kpgp's editor decrypts the mail, if I copy the sourcecode, thus enc. seems
> to work.
>
> :-)
>
> I guess I will try to remove ~/gnupg and try again.
>
> > Btw, previous posts : http://lists.kde.org/?t=118673691300005&r=1&w=2
> >
> > acp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch_gpgme_passphrase_cb
Type: text/x-diff
Size: 3007 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20070823/a06788c5/attachment.diff>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list