Divorcing KWallet from KMail

Splitsville

© Lead Image © oporty, 123RF.com

© Lead Image © oporty, 123RF.com

Article from Issue 306/2026
Author(s):

KDE's password manager, KWallet, can be an annoyance. While it can't be completely disabled, the nuisance can be minimized.

KMail, KDE's default email browser, features a comprehensive set of graphical features, including filter creation, spam detection, archiving, and encryption, as well as extensive customization. All of these features make KMail an attractive choice, except for one thing: its default use of the KWallet password manager.

The intrusive KWallet constantly pops up for seemingly every action, resulting in many users wanting to disable it. Unfortunately, recent releases of KMail default to using KWallet without providing alternatives, not even manually entering passwords. Consequently, disabling KWallet can be difficult, and disabling cannot prevent error messages.

The problem is largely due to how KMail interacts with the rest of KDE. Like other personal information in KDE, KMail is administered by Akonadi, KDE's general storage system for personal information. Akonadi is seriously undocumented, and users often have to study the source code for information. Even worse, Akonadi has a history of frequent problems. Online, you can easily find complaints about the difficulty of working with Akonadi. For example, one Reddit post has as a subject line, "Akonadi is making me lose my will to live." While the original post has been removed, its first comment explains that "Akonadi can be … problematic. I've been using the whole Kontact suite for about two years now; it hasn't been terrible for me but I experienced several serious long-standing bugs along the way." The comment goes on to complain, "there are so many awesome new KDE apps such as Kalendar that I'd love to use but that all use Akonadi in the background" [1]. These sentiments are far from rare.

The problem with KWallet in particular begins with the intent behind it: to password-protect users' email. This at first sounds reasonable. However, with passwords, encryption, and screen locks available on modern desktops, is an additional layer of security even necessary? Certainly most other email browsers do not have a password manager. KWallet is all the more irritating because Akonadi requires the password for KMail before it allows many, if not all, basic functions. In any session, users can expect to be asked frequently to re-enter the password. In theory, security should prevail over convenience, but KWallet seems unnecessary and may take some users several tries to set up. Moreover, while KWallet can be used with apps that are not controlled by Akonadi, Linux has no shortage of password managers, such as Bitwarden, Buttercup, and KeePassXC, and users can easily find an alternative that is more flexible. All of this explains why KWallet is as widely criticized as Akonadi. "Why is Kdewallet so bad and for so long?" asks another Reddit post, whose comments include "It looks like KWallet is just bad designed and unfixable at this stage," while another comment notes that "most of the documentation teaches how to SKIP or DISABLE the wallet instead of how to use it" [2].

Disabling Tactics

By my count, KWallet is a dependency for 27 KDE packages, including core packages like Plasma Workspace. For this reason, disabling KWallet with apt will break your desktop. While disabling Akonadi might seem like a reasonable solution, starting any personal information app like KMail automatically starts it. Instead, disabling often requires a roundabout approach. However, be careful of approaches taken from the Internet. KWallet has had different implementations over the years, and what once worked may no longer be effective or only work on a specific distribution.

In theory, disabling KWallet seems easy. A search in the System Settings reveals a KWallet page (Figure 1) . Uncheck the box at the top of the page and click Apply, and KWallet should be disabled. The problem is, in some distributions (including Debian), unchecking may not be possible. When you enter your password to apply the change, you may receive an error message. Alternatively, when you return to the page a second time, the box may be checked again. Either way, you must look for another solution.

Figure 1: In theory, the KWallet page in System Settings can turn off KWallet. However, that's not true in all distributions.

As you work with KWallet, use either KWallet Manager (Figure 2) or kwalletcli if available. Some distributions, such as Ubuntu, do not include kwalletcli in their repositories.

Figure 2: The graphical tool for KWallet.

Depending on the distribution, one of the following workarounds should work:

  • In KWallet, set a wallet for KMail with the same password as your user account, and in System Settings, autostart KMail. Then add the PAM module(s) for KWallet, whose name varies with the distribution. KWallet will be open at login, which should at least cut down on the number of password requests
  • Delete ~/.local/share/kwalletd. KWallet will create a new directory and ask for an encryption method. Choose the Classic Blowfish encrypted file, but leave the password blank and ignore the warning that the password is weak (Figure 3).
Figure 3: Setting a blank password.
  • Create an environmental variable for your shell profile, such as .bashrc. At the end of the file, enter the line
export KWALLET_DISABLE=1

You may still receive messages from Akonadi asking for a password. The same line can be added to /etc/environment to disable KWallet for all users.

  • In ~/.config/kwalletrc, add
[Wallet]
Enabled=false

One of these methods should work. However, package names and file names may vary with the distribution. Usually, the names should be close to the ones given here. These methods should also work for most applications that are governed by Akonadi. Once KWallet is disabled, passwords will continue to be stored in clear text in Akonadi's database, so be sure to use all the ordinary security features for your account.

Shortcomings

Note that these workarounds only affect KWallet. After they are applied, Akonadi continues to look for KWallet and does not recognize that it is disabled. Not finding it enabled, pop-up windows will appear, asking for passwords. These pop-ups are indiscriminate: Even if an email account is set as POP3 (Figure 4), Akonadi will also look for IMAP versions of the account in an effort to find what is simply not there. However, the IMAP error message disappears in a few seconds, and error windows for other accounts can be ignored or closed. KMail will simply continue to function sending and receiving email despite them. If the nuisances are not completely eliminated, they are at least greatly reduced, leaving you to benefit from KMail's extensive feature set with minimal distraction.

Figure 4: After KWallet is disabled, error messages still appear but can be ignored.

The Author

Bruce Byfield is a computer journalist and a freelance writer and editor specializing in free and open source software. In addition to his writing projects, he also teaches live and e-learning courses. In his spare time, Bruce writes about Northwest Coast art (http://brucebyfield.wordpress.com). He is also cofounder of Prentice Pieces, a blog about writing and fantasy at https://prenticepieces.com/.

Buy this article as PDF

Download Article PDF now with Express Checkout
Price $2.95
(incl. VAT)

Buy Linux Magazine

Related content

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News