Bug 410872

Summary: Kmail reports "Could not read the password" when trying to set an IMAP account online
Product: [Frameworks and Libraries] Akonadi Reporter: Lari Natri <lari.natri>
Component: Gmail resourceAssignee: Daniel Vrátil <dvratil>
Status: REPORTED ---    
Severity: normal CC: auxsvr, bugs.kde.org, dtombaugh, kdepim-bugs, kishore96, lari.natri, mdedetrich
Priority: NOR    
Version: 5.10.3   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Lari Natri 2019-08-13 10:38:01 UTC
SUMMARY


STEPS TO REPRODUCE
1. Try to set Gmail IMAP account online by checking mail.

OBSERVED RESULT
The account stays offline (folders are marked red) and the message "Could not read the password. User rejected wallet access" message can be seen in the Kmail's account settings. If password is changed there, it is updated correctly to the wallet as seen in Wallet Manager, but the error persists nevertheless.

EXPECTED RESULT
Account goes online and new messages are downloaded. (Actually, normally the account is online automatically.)


SOFTWARE/OS VERSIONS
Linux: 5.0.0-23
KDE Plasma Version: 5.16.4
KDE Frameworks Version: 5.60.0
Qt Version: 5.12.2

ADDITIONAL INFORMATION

KDE wallet is opened normally (at login through PAM) and Wallet Manager displays the wallet open and "kontact" as an attached application.

The problem appeared suddenly on two different machines around 10.8.2019, possibly after a package update. One system is Kubuntu 18.04 LTS and the other is Kubuntu 19.04, both with KDE backports repository enabled.

I noticed that around the time of the problem appearing, an update was installed to mitigate the .desktop file vulnerability. The following packages were upgraded:

libkf5config-data:amd64 (5.60.0-0ubuntu1~ubuntu19.04~ppa1, 5.60.0-0ubuntu2~ubuntu19.04~ppa1), libkf5configcore5:amd64 (5.60.0-0ubuntu1~ubuntu19.04~ppa1, 5.60.0-0ubuntu2~ubuntu19.04~ppa1), libkf5configgui5:amd64 (5.60.0-0ubuntu1~ubuntu19.04~ppa1, 5.60.0-0ubuntu2~ubuntu19.04~ppa1), dpkg:amd64 (1.19.6ubuntu1, 1.19.6ubuntu1.1), libkf5config-dev-bin:amd64 (5.60.0-0ubuntu1~ubuntu19.04~ppa1, 5.60.0-0ubuntu2~ubuntu19.04~ppa1), libkf5config-bin:amd64 (5.60.0-0ubuntu1~ubuntu19.04~ppa1, 5.60.0-0ubuntu2~ubuntu19.04~ppa1), libkf5config-dev:amd64 (5.60.0-0ubuntu1~ubuntu19.04~ppa1, 5.60.0-0ubuntu2~ubuntu19.04~ppa1), libkf5config-doc:amd64 (5.60.0-0ubuntu1~ubuntu19.04~ppa1, 5.60.0-0ubuntu2~ubuntu19.04~ppa1), libdpkg-perl:amd64 (1.19.6ubuntu1, 1.19.6ubuntu1.1), dpkg-dev:amd64 (1.19.6ubuntu1, 1.19.6ubuntu1.1)

My apologies, if this is a distribution specific bug, or if it is tagged with a wrong package.
Comment 1 Lari Natri 2019-08-13 10:51:44 UTC
I've reported this bug also on Ubuntu's bug tracker: https://bugs.launchpad.net/akonadi/+bug/1840007
Comment 2 Lari Natri 2019-08-19 19:19:35 UTC
The underlying problem seems to be the one described in bug #404990.

The workaround mentioned in its 2nd comment, using PLAIN authentication method, fixes the problem.

The problem has nothing to do with KDE Wallet unlike the very misleading Kmail error -- that's why I'm not marking this bug as a duplicate.
Comment 3 Tom Chiverton 2019-11-12 21:50:02 UTC
Workaround doesn't work in Kmail v5.7.3 because both password and connection settings (to set to "plain") are disabled.
Even for a freshly created IMAP connection.
Something in KDE is disabling these because the email is @gmail ?
Comment 4 Tom Chiverton 2019-11-12 21:56:24 UTC
As soon as you set the IMAP server to imap.gmail.com you can see the password field goes disabled and the advanced connection settings are disabled and "gmail" type is forced.
This "helpful" would seem easy to undo, and then at least there would then be a way to connect KMail to Gmail again, because right now the feature is dead (and has been for months ?!?).
Comment 5 Tom Chiverton 2019-11-12 22:09:26 UTC
Can't even work around this by using Akonadi Console to ('configure remote') set the Authentication to "1" instead of "9" because it's reset shortly after Kmail starts, and you get the popup of doom from Google again :(
Comment 6 gbyte.dev 2020-11-04 13:51:57 UTC
Has anyone found a working workaround?
Comment 7 auxsvr 2022-07-13 05:00:44 UTC
A workaround is in https://forum.kde.org/viewtopic.php?f=215&t=153459&sid=090ec7556cc1586493bcb7323f7c3404:

> Open KWalletManager > Search for LibKGAPI > Maps > *usercontent.com. Remove all entries from there.

It works for me.
Comment 8 Aitor 2022-11-30 19:01:15 UTC
*** Bug 451998 has been marked as a duplicate of this bug. ***