Bug 437091

Summary: Saving edited identity clears cryptographic keys not matching email address
Product: [Applications] kmail2 Reporter: Ingo Klöcker <kloecker>
Component: config dialogAssignee: Ingo Klöcker <kloecker>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 5.16.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.18.0

Description Ingo Klöcker 2021-05-14 15:12:47 UTC
I have a few identities where the email address does not match any of the
user ids of the OpenPGP keys configured for those identities. (Note: Because of bug 404700 it is currently not easily possible to set cryptographic keys that do not match the email address for an identity.)

If I edit such an identity in the configuration dialog, then the OpenPGP signing/encryption key drop down boxes on the Cryptography tab show "No key" instead of the key I have set for this identity.
-> I expect to see the configured keys there.

If I save the edited identity after having opened the Cryptography tab, then
the OpenPGP keys of the edited identity are cleared.
-> Obviously, I except KMail not to clear the keys silently.
Comment 1 Ingo Klöcker 2021-05-14 15:26:22 UTC
Git commit 5de2f7ac770c6982f98837018cd7ae2a29686501 by Ingo Klöcker.
Committed on 14/05/2021 at 15:15.
Pushed by kloecker into branch 'master'.

Always include the default key in the list of keys to chose from

Add custom subclass of KeyListSortFilterProxyModel that allows specifying
a key that is always accepted by the filtering. Use this subclass
to make sure that the default key is not filtered out.

This fixes the problem that KMail didn't show keys not matching
the email address of an identity in the identity configuration dialog
and that KMail cleared the keys silently if one saved such an identity
after opening the Cryptography tab.

Funded by: Intevation GmbH
FIXED-IN: 5.18.0

M  +39   -3    src/ui/keyselectioncombo.cpp

https://invent.kde.org/pim/libkleo/commit/5de2f7ac770c6982f98837018cd7ae2a29686501