Bug 465815 - KMail assumes KDEWallet as Secret Service provider, breaking other alternatives
Summary: KMail assumes KDEWallet as Secret Service provider, breaking other alternatives
Status: CONFIRMED
Alias: None
Product: kmail2
Classification: Applications
Component: general (show other bugs)
Version: 6.2.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-16 05:13 UTC by Odin Vex
Modified: 2024-10-14 19:24 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Odin Vex 2023-02-16 05:13:38 UTC
SUMMARY
KMail is assuming that KDEWallet is the Secret Service that can exist and attempts to detect it by forcibly detecting *only* KDE Wallet, instead of simply asking on the dbus if a Secret Service provider exists (such as KeePassXC). SMTP can be fetched from KeePassXC, but *not* IMAP credentials.


STEPS TO REPRODUCE
1. Disable KDEWallet.
2. Use any other Secret Service provider (such as KeePassXC).
3. Attempt to '&Modify...' a Receiving entry for an IMAP account.

OBSERVED RESULT
Error Message: Could not access KWallet. If you want to store the password permanently then you have to activate it. If you do not want to use KWallet, check the box below, but note that you will be prompted for your password when needed.

EXPECTED RESULT
KMail should accept alternative Secret Service providers.

SOFTWARE/OS VERSIONS
Linux: Manjaro 22
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
SMTP is remembered correctly, but not anything relating to IMAP. POP3 may be affected, unchecked.
Comment 1 Bernardo Marx 2023-06-18 08:52:34 UTC
+1
Comment 2 steppecat 2023-06-23 10:20:15 UTC
+1
Comment 3 lod 2023-11-27 20:45:33 UTC
Same problem in the latest Version.
Comment 4 Witko 2024-01-05 08:54:53 UTC
This really breaks the usability of Kmail. As KDEWallet does not work with browsers its not a viable option for most users. Apart from that using the security service should be the right approach.
I believe it happens here: https://github.com/KDE/kdepim-runtime/blob/master/resources/imap/settings.cpp
Thank you!
Comment 5 Odin Vex 2024-07-18 05:49:24 UTC
KMail does store secrets into whatever Secret Service is "listening" when setting up an account or logging in but it will not -read- from anything but KDEWallet it seems. It also doesn't wait for the Secret Service to be unlocked.
Comment 6 Odin Vex 2024-07-18 05:50:57 UTC
I think perhaps all of Akonadi software might need updating, too. Tokodon and Neochat work correctly.
Comment 7 Odin Vex 2024-10-04 05:23:23 UTC
I recently got an update to 6.2.1 (24.08.1-1) and things are worse. Instead of it prompting for a password every time to maintain an IMAP connection (which also got to count for SMTP) it now won't even prompt me and doesn't allow synchronizing at all. I'm unable to send or receive any mail at all.
Comment 8 Odin Vex 2024-10-04 05:26:27 UTC
(In reply to Odin Vex from comment #7)
> I recently got an update to 6.2.1 (24.08.1-1) and things are worse. Instead
> of it prompting for a password every time to maintain an IMAP connection
> (which also got to count for SMTP) it now won't even prompt me and doesn't
> allow synchronizing at all. I'm unable to send or receive any mail at all.

The specific error message is:

-------------------
Resource [REDACTED] is broken.
Could not read the password: user rejected wallet access 
-------------------

I never rejected access and KeePassXC always grants without prompting (but does show a notification to me).
Comment 9 kapsh 2024-10-04 07:39:27 UTC
> I never rejected access and KeePassXC always grants without prompting (but
> does show a notification to me).

You seems to have kwallet disabled completely, so kmail cannot access it and shows incorrect error. Keepass, playing secret service part in this case, is never reached. 
Starting from 6.1.5 should be possible to enable kwallet and it's secret service support separately (restart akonadi and kmail after doing that). Doing that fixes kmail, remembering networks passwords, etc. I'd still prefer it used secret service though.
Comment 10 Odin Vex 2024-10-04 15:13:06 UTC
(In reply to kapsh from comment #9)
> > I never rejected access and KeePassXC always grants without prompting (but
> > does show a notification to me).
> 
> You seems to have kwallet disabled completely, so kmail cannot access it and
> shows incorrect error. Keepass, playing secret service part in this case, is
> never reached. 
> Starting from 6.1.5 should be possible to enable kwallet and it's secret
> service support separately (restart akonadi and kmail after doing that).
> Doing that fixes kmail, remembering networks passwords, etc. I'd still
> prefer it used secret service though.

I did disable kwallet as I had no need for it to be running. Thank you, I've temporarily re-enabled it and can use IMAP/SMTP/POP3 with no issues. It's a tolerable work-around for now. :)
Comment 11 Odin Vex 2024-10-04 21:05:20 UTC
(In reply to Odin Vex from comment #10)
> (In reply to kapsh from comment #9)
> > > I never rejected access and KeePassXC always grants without prompting (but
> > > does show a notification to me).
> > 
> > You seems to have kwallet disabled completely, so kmail cannot access it and
> > shows incorrect error. Keepass, playing secret service part in this case, is
> > never reached. 
> > Starting from 6.1.5 should be possible to enable kwallet and it's secret
> > service support separately (restart akonadi and kmail after doing that).
> > Doing that fixes kmail, remembering networks passwords, etc. I'd still
> > prefer it used secret service though.
> 
> I did disable kwallet as I had no need for it to be running. Thank you, I've
> temporarily re-enabled it and can use IMAP/SMTP/POP3 with no issues. It's a
> tolerable work-around for now. :)

I've discovered a side-effect. Re-enabling kwallet breaks Vorta (Backup) since it attempts to use KDE Wallet if it's enabled instead of Secret Service. I think the answer is to stop KMail from requiring kwallet. I can maintain patches for my own Vorta repo clone until their developer(s) consider removing special handling for kwallet.