SUMMARY When I set a certain default identity for an IMAP resource, that identity is not used for the IMAP folders and does not persist. STEPS TO REPRODUCE 1. Set the default identity of an IMAP resource to X. 2. Go to the folder settings of any folder within that IMAP and make sure that the box is ticked to use the default identity. 3. Compose a new email. 4. Manually set the folder identity to X and restart KMail. EXPECTED RESULT The new email uses identity X. Additionally, the IMAP and folder identity settings persist after restarting KMail. OBSERVED RESULT The global standard identity is used. Additionally, the settings do not persist but revert to the global default. This only happens for some identities. It is serious because it means that composing a new email from within an IMAP folder can accidentally use the wrong identity if the user is not careful and therefore expose sensitive addresses. SOFTWARE/OS VERSIONS Kmail: 5.16.3 KDE Plasma Version: 5.21.4 KDE Frameworks Version: 5.81.0 Qt Version: 5.15.2 ADDITIONAL INFORMATION Possible duplicate of https://bugs.kde.org/show_bug.cgi?id=401936 but I observed additional issues (the fact that the default identity of the IMAP resource is ignored) and cannot verify that it is indeed the same.
I believe I have narrowed down the issue. Going to ~/.config/emailidentities, I noticed that the uoid of the identity X is a larger 10-digit number than that of all the other identities. Manually editing the file and setting the uoid to something smaller resolves the problem. In fact, the bug reappears exactly when the uoid is set to something larger than 2^31-1, so it looks to me like the uint uoid is not treated as an unsigned int somewhere. I had a brief look at the source but could not find where.