Version: 4.4 (using KDE 4.4.5) OS: Linux I have several contacts in my address book which have GnuPG keys attached to them which do not match the e-mail address of the contact; thus, I rely on the feature to set the right GnuPG key in KAddressbook. However, when sending encrypted mail to these contacts using KMail it never picks up on the selected key but reports that no key were found. I am then presented with a list of my GnuPG keys to select who to encrypt to. Reproducible: Always Steps to Reproduce: 1) Add a new contact 2) Add several GnuPG Keys to that contact 3) Write an e-mail to that contact and select encryption and click send. Actual Results: The selected GnuPG keys are not used but one has to select them again by hand. Expected Results: KMail picks up on my choice in the KAddressbook and encrypts to the specified keys.
Here's an easier way to reproduce the problem: SETUP: a) Send an e-mail to some made-up contact, e.g. x@y.com; select GnuPG encryption b) KMail will ask you what key to choose, pick one and check "Remember choice" c) KMail will ask you for a name for the new contact, pick one e.g. "XY" d) KMail will ask you where to store the contact, pick your default address book CHECK: g) Observe that your default address book now indeed contains a contact XY for the e-mail address x@y.com with the GnuPG key assigned you just picked MAKE IT FAIL: g) Repeat a) EXPECTED BEHAVIOUR: KMail knows which key to chose and will do so automatically OBSERVED BEHAVIOUR: Kmail performs the steps mentioned in b)-d) PS: I can try to gather debug logs from akonadi if that'd be of any use.
My attempts to debug this came this far, the function which does the Akonadi call is Kleo::KeyResolver::ContactPreferences Kleo::KeyResolver::lookupContactPreferences( const QString& address ) const in keyresolver.cpp. The Akonadi query which comes back empty looks as follows: SEARCH "prefix nco:<http://www.semanticdesktop.org/ontologies/2007/03/22/nco#>SELECT DISTINCT ?person WHERE { graph ?g { ?person a nco:PersonContact ; ?person <http://akonadi-project.org/ontologies/aneo#akonadiItemId> ?itemId . nco:hasEmailAddress ?email . ?email nco:emailAddress \"x@y.com\"^^<http://www.w3.org/2001/XMLSchema#string> . } } LIMIT 1" FULLPAYLOAD EXTERNALPAYLOAD (UID REMOTEID COLLECTIONID FLAGS SIZE DATETIME) I don't speak enough SPARQL to judge whether this is correct. I noticed the ";" which is a different construction from the other queries in that file. However, if I replace the call to job->setQuery( Akonadi::ContactSearchJob::Email, address ); with job->setQuery( Akonadi::ContactSearchJob::Name, address ); (which of course is wrong) and replace the name of my contact with its e-mail address, KMail shows the correct behaviour, implying that indeed the search query for Email is wrong in 4.4.5
I can confirm this bug. Remembering the preferred key for a recipient does not work at all. I am always forced to choose a key because of the failed lookup. I am using kmail 1.13.5 (KDE 4.4.5) from Debian's testing distribution.
This discussion looks relevant: http://lists.kde.org/?l=kde-pim&m=129923342305966&w=2
The bug affects me too using kmail 1.13.5. with kubuntu 10.10. The problem does not occur with kmail 1.13.6. tested with the beta-release of kubuntu 11.04.
After updating to the final version of Kubuntu 11.04 (kmail 1.13.6), I am experiencing the same problem. Maybe I did some mistake in reproducing the bug back then, or something changed, or it has something to do with the configuration... hope very much this will be fixed soon.
With KMail 1.13.7 from Debian the problem seems to be fixed.
It seems the bug is back. It is still KMail 1.13.7 in Debian testing. Akonadi was recently updated to 1.7.2 from 1.6.2.