Mailspring Could not Store your account securely -- BUG

Description

I updated to Plasma 6.0.1 on Archlinux, I started getting the following error when I try to open mailspring:

This happens every time I try to login to mailspring. Both libsecretand gnome-keyring is installed.

Expected Behavior

I expect mailspring to authenticate my account and the window to disappear

Setup

Archlinux Mailspring 1.13.3-1

I am facing the same issue after updating Plasma from 5.27.10 to 6.0.1. None of my accounts are operational and I am not able to reauthenticate or add new ones. It seems to have something to do with KWallet integration as per the console output below. Other applications using KWallet (Chromium, Element [electron client]) are continuing to work normally after the Plasma update.

Setup

Mailspring 1.13.3-9a7e1a78
KDE Plasma 6.0.1
Arch Linux 6.7.8-arch1-1

Screenshots

Console Output

~ ❯ mailspring
Running database migrations
App load time: 163ms

{"error":null}
src/gbm_drv_common.c:130: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808530000

src/gbm_drv_common.c:130: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808530000

src/gbm_drv_common.c:130: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808530000

src/gbm_drv_common.c:130: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808530000

src/gbm_drv_common.c:130: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808530000

Manual update check (updates.getmailspring.com/check/linux/x64/1.13.3-9a7e1a78/anonymous/stable) returned 204
[9531:0307/185810.870883:ERROR:object_proxy.cc(623)] Failed to call method: org.kde.KWallet.isEnabled: object_path= /modules/kwalletd: org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
[9531:0307/185810.870902:ERROR:kwallet_dbus.cc(100)] Error contacting kwalletd (isEnabled)
[9531:0307/185810.870984:ERROR:object_proxy.cc(623)] Failed to call method: org.kde.KLauncher.start_service_by_desktop_name: object_path= /KLauncher: org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
[9531:0307/185810.870992:ERROR:kwallet_dbus.cc(72)] Error contacting klauncher to start kwalletd
[9531:0307/185810.871054:ERROR:object_proxy.cc(623)] Failed to call method: org.kde.KWallet.close: object_path= /modules/kwalletd: org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
[9531:0307/185810.871061:ERROR:kwallet_dbus.cc(418)] Error contacting kwalletd (close)
Error: Could not call remote method 'encryptString'. Check that the method signature is correct. Underlying error: Error: Error while decrypting the ciphertext provided to safeStorage.decryptString. Encryption is not available.Underlying stack: Error: Error while decrypting the ciphertext provided to safeStorage.decryptString. Encryption is not available.
    at /usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:465:71
    at IpcMainImpl.<anonymous> (/usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:323:27)
    at IpcMainImpl.emit (node:events:513:28)
    at IpcMainImpl.emit (node:domain:489:12)
    at EventEmitter.<anonymous> (node:electron/js2c/browser_init:2:82058)
    at EventEmitter.emit (node:events:513:28)
    at EventEmitter.emit (node:domain:489:12)

    at /usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:468:25
    at IpcMainImpl.<anonymous> (/usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:323:27)
    at IpcMainImpl.emit (node:events:513:28)
    at IpcMainImpl.emit (node:domain:489:12)
    at EventEmitter.<anonymous> (node:electron/js2c/browser_init:2:82058)
    at EventEmitter.emit (node:events:513:28)
    at EventEmitter.emit (node:domain:489:12) {
  cause: {
    stack: 'Error: Error while decrypting the ciphertext provided to safeStorage.decryptString. Encryption is not available.\n' +
      '    at /usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:465:71\n' +
      '    at IpcMainImpl.<anonymous> (/usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:323:27)\n' +
      '    at IpcMainImpl.emit (node:events:513:28)\n' +
      '    at IpcMainImpl.emit (node:domain:489:12)\n' +
      '    at EventEmitter.<anonymous> (node:electron/js2c/browser_init:2:82058)\n' +
      '    at EventEmitter.emit (node:events:513:28)\n' +
      '    at EventEmitter.emit (node:domain:489:12)',
    message: 'Error while decrypting the ciphertext provided to safeStorage.decryptString. Encryption is not available.'
  }
} { pluginIds: [] }
(node:9531) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
(Use `mailspring --trace-deprecation ...` to show where the warning was created)

i also thought about kwallet integration issues, but it seems to be a problem with gnome-keyring specifically. I am not sure if mailspring uses kwallet at all (might be wrong)

Seeing this as well after updating to KDE 6 on Arch Linux today, along with a number of matching reports. Moving into this thread and referencing from the others to hopefully consolidate.

Mailspring does use kwallet albeit may be indirectly, I did notice a new setting in KWallet haven’t seen before though I also haven’t looked in quite a while - the “Use KWallet for the Secret Service interface” which is enabled and blocks other applications (including gnome keyring etc) :thinking: Tried disabling that briefly and re-trying but no change :man_shrugging:

Seems like it can’t contact kwalletd anymore, note also running with UseOzonePlatform and --ozone-platform=wayland to force wayland vs xwayland.
Console log

[23821:0311/162206.733397:ERROR:gpu_init.cc(523)] Passthrough is not supported, GL is egl, ANGLE is 
Running database migrations
App load time: 238ms

{"error":null}
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to open nvidia-drm: /usr/lib/dri/nvidia-drm_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
MESA-LOADER: failed to open kms_swrast: /usr/lib/dri/kms_swrast_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
Manual update check (updates.getmailspring.com/check/linux/x64/1.13.3-9a7e1a78/(removed uid looking thing just in case)/stable) returned 204
[23779:0311/162207.286083:ERROR:object_proxy.cc(623)] Failed to call method: org.kde.KWallet.isEnabled: object_path= /modules/kwalletd: org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
[23779:0311/162207.286096:ERROR:kwallet_dbus.cc(100)] Error contacting kwalletd (isEnabled)
[23779:0311/162207.286218:ERROR:object_proxy.cc(623)] Failed to call method: org.kde.KLauncher.start_service_by_desktop_name: object_path= /KLauncher: org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
[23779:0311/162207.286226:ERROR:kwallet_dbus.cc(72)] Error contacting klauncher to start kwalletd
[23779:0311/162207.286277:ERROR:object_proxy.cc(623)] Failed to call method: org.kde.KWallet.close: object_path= /modules/kwalletd: org.freedesktop.DBus.Error.ServiceUnknown: The name is not activatable
[23779:0311/162207.286282:ERROR:kwallet_dbus.cc(418)] Error contacting kwalletd (close)
TypeError: Cannot read properties of null (reading 'expiration')
    at Message.metadataForPluginId (file:///tmp/nylas-build/electron-packager/linux-x64/mailspring-linux-x64-6Ns7Ou/resources/app/src/flux/models/model-with-metadata.ts:82:15)
    at file:///tmp/nylas-build/electron-packager/linux-x64/mailspring-linux-x64-6Ns7Ou/resources/app/internal_packages/activity/lib/activity-event-store.tsx:123:36
    at Array.forEach (<anonymous>)
    at ActivityEventStore._onUpdateActivity (file:///tmp/nylas-build/electron-packager/linux-x64/mailspring-linux-x64-6Ns7Ou/resources/app/internal_packages/activity/lib/activity-event-store.tsx:121:73)
    at AnonymousObserver._onNext (file:///tmp/nylas-build/electron-packager/linux-x64/mailspring-linux-x64-6Ns7Ou/resources/app/internal_packages/activity/lib/activity-event-store.tsx:43:16)
    at AnonymousObserver.Rx.AnonymousObserver.AnonymousObserver.next (/usr/share/mailspring/resources/app.asar/node_modules/rx-lite/rx.lite.js:1668:12)
    at AnonymousObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/usr/share/mailspring/resources/app.asar/node_modules/rx-lite/rx.lite.js:1602:31)
    at AnonymousObserver.tryCatcher (/usr/share/mailspring/resources/app.asar/node_modules/rx-lite/rx.lite.js:67:31)
    at AutoDetachObserverPrototype.next (/usr/share/mailspring/resources/app.asar/node_modules/rx-lite/rx.lite.js:6495:51)
    at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/usr/share/mailspring/resources/app.asar/node_modules/rx-lite/rx.lite.js:1602:31)
    at file:///tmp/nylas-build/electron-packager/linux-x64/mailspring-linux-x64-6Ns7Ou/resources/app/src/global/mailspring-observables.ts:156:77
    at file:///tmp/nylas-build/electron-packager/linux-x64/mailspring-linux-x64-6Ns7Ou/resources/app/src/flux/models/query-subscription.ts:322:41
    at Array.forEach (<anonymous>)
    at QuerySubscription._createResultAndTrigger (file:///tmp/nylas-build/electron-packager/linux-x64/mailspring-linux-x64-6Ns7Ou/resources/app/src/flux/models/query-subscription.ts:322:21)
    at file:///tmp/nylas-build/electron-packager/linux-x64/mailspring-linux-x64-6Ns7Ou/resources/app/src/flux/models/query-subscription.ts:277:12 { pluginIds: [ 'activity' ] }
(node:23779) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
(Use `mailspring --trace-deprecation ...` to show where the warning was created)
Raven: 429 - undefined

[NOTE Try re-setting up mailspring ID and then -]

Error: Could not call remote method 'encryptString'. Check that the method signature is correct. Underlying error: Error: Error while decrypting the ciphertext provided to safeStorage.decryptString. Encryption is not available.Underlying stack: Error: Error while decrypting the ciphertext provided to safeStorage.decryptString. Encryption is not available.
    at /usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:465:71
    at IpcMainImpl.<anonymous> (/usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:323:27)
    at IpcMainImpl.emit (node:events:513:28)
    at IpcMainImpl.emit (node:domain:489:12)
    at EventEmitter.<anonymous> (node:electron/js2c/browser_init:2:82058)
    at EventEmitter.emit (node:events:513:28)
    at EventEmitter.emit (node:domain:489:12)

    at /usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:468:25
    at IpcMainImpl.<anonymous> (/usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:323:27)
    at IpcMainImpl.emit (node:events:513:28)
    at IpcMainImpl.emit (node:domain:489:12)
    at EventEmitter.<anonymous> (node:electron/js2c/browser_init:2:82058)
    at EventEmitter.emit (node:events:513:28)
    at EventEmitter.emit (node:domain:489:12) {
  cause: {
    stack: 'Error: Error while decrypting the ciphertext provided to safeStorage.decryptString. Encryption is not available.\n' +
      '    at /usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:465:71\n' +
      '    at IpcMainImpl.<anonymous> (/usr/share/mailspring/resources/app.asar/node_modules/@electron/remote/dist/src/main/server.js:323:27)\n' +
      '    at IpcMainImpl.emit (node:events:513:28)\n' +
      '    at IpcMainImpl.emit (node:domain:489:12)\n' +
      '    at EventEmitter.<anonymous> (node:electron/js2c/browser_init:2:82058)\n' +
      '    at EventEmitter.emit (node:events:513:28)\n' +
      '    at EventEmitter.emit (node:domain:489:12)',
    message: 'Error while decrypting the ciphertext provided to safeStorage.decryptString. Encryption is not available.'
  }
} { pluginIds: [] }
Raven: 429 - undefined

Had this exact issue. Uninstalled Mailspring, deleted the /home/user/.config/Mailspring directory, reinstalled and before starting it up. Edited the desktop shortcut to the following (note the exec line)

cat /usr/share/applications/Mailspring.desktop 
[Desktop Entry]
Name=Mailspring
Comment=The best email app for people and teams at work
GenericName=Mail Client
Exec=mailspring --password-store="gnome-libsecret" %U

Note you also have to disable Mailspring from staring up manually and only launch from the app. Hope that helps.

1 Like

Worked for me on endeavouros with plasma 6 :+1:

@mercifulboss @shibijm @F1nny @Billygoat32 @Volondil

finally got a Fedora 40 KDE running for me and was able to find a workaround that actually worked smoothly for me and that does nod need a gnome library to be installed. Please try to use kwallet5 as the backend store for the password encryption. I have documented this here: Password Management Error - #2 by system

@Jaycee99 What error message do you get on installation? I have only seen the errors described here during startup and not during installation.

I’m having the same issue here when going through the “Get Started” screen after installing. However, I am on PopOS LTS 24.04. I have gnome-keyring and libsecret installed as well but I get the same pop up as the OP:

Mailspring could not store your password securely

X11 isn’t installed/running on my system. I am on Wayland using the Cosmic DE. Looking at the logs, I see the following so it’s expecting X11 somewhere:

❯ tail -f /var/log/syslog ─╯
2025-10-09T18:49:11.680298-04:00 themonster cosmic-comp[4846]: Failed to handle X11 event
2025-10-09T18:49:13.933699-04:00 themonster cosmic-comp[4846]: [GL] GL_INVALID_VALUE error generated. Size and/or offset out of range.
2025-10-09T18:51:20.373164-04:00 themonster PackageKit: daemon quit
2025-10-09T18:51:20.388320-04:00 themonster systemd[1]: packagekit.service: Deactivated successfully.
2025-10-09T18:51:20.388417-04:00 themonster systemd[1]: packagekit.service: Consumed 1.798s CPU time.
2025-10-09T18:52:27.965873-04:00 themonster rtkit-daemon[3621]: Supervising 6 threads of 3 processes of 1 users.
2025-10-09T18:52:36.060885-04:00 themonster rtkit-daemon[3621]: message repeated 3 times: [ Supervising 6 threads of 3 processes of 1 users.]
2025-10-09T18:55:14.552800-04:00 themonster systemd[1]: Starting systemd-tmpfiles-clean.service - Cleanup of Temporary Directories…
2025-10-09T18:55:14.576965-04:00 themonster systemd[1]: systemd-tmpfiles-clean.service: Deactivated successfully.
2025-10-09T18:55:14.577293-04:00 themonster systemd[1]: Finished systemd-tmpfiles-clean.service - Cleanup of Temporary Directories.

2025-10-09T18:55:48.052804-04:00 themonster cosmic-comp[4846]: [GL] GL_INVALID_VALUE error generated. Size and/or offset out of range.
2025-10-09T18:55:53.996473-04:00 themonster cosmic-comp[4846]: message repeated 2 times: [ [GL] GL_INVALID_VALUE error generated. Size and/or offset out of range.]
2025-10-09T18:55:56.315219-04:00 themonster systemd[4753]: app-flatpak-com.getmailspring.Mailspring-1363329519.scope: Consumed 12.009s CPU time.
2025-10-09T18:55:56.354295-04:00 themonster systemd[4753]: app-flatpak-com.getmailspring.Mailspring-1997804884.scope: Consumed 56.495s CPU time.
2025-10-09T18:56:03.235861-04:00 themonster cosmic-launcher[18238]: CosmicTk config entry error
2025-10-09T18:56:03.236207-04:00 themonster cosmic-launcher[18238]: message repeated 6 times: [ CosmicTk config entry error]
2025-10-09T18:56:08.150853-04:00 themonster systemd[4753]: Started app-cosmic-com.getmailspring.Mailspring-18311.scope - Application launched by COSMIC.
2025-10-09T18:56:08.156145-04:00 themonster systemd[4753]: Started app-flatpak-com.getmailspring.Mailspring-2618097969.scope.
2025-10-09T18:56:08.380580-04:00 themonster systemd[4753]: Started app-flatpak-com.getmailspring.Mailspring-104603997.scope.
2025-10-09T18:56:14.313834-04:00 themonster systemd[4753]: Started dbus-:1.1-org.freedesktop.portal.IBus@3.service.
2025-10-09T18:56:14.317558-04:00 themonster ibus-portal[18600]: Not connected to the ibus bus
2025-10-09T18:56:14.318161-04:00 themonster systemd[4753]: dbus-:1.1-org.freedesktop.portal.IBus@3.service: Main process exited, code=exited, status=1/FAILURE
2025-10-09T18:56:14.318317-04:00 themonster systemd[4753]: dbus-:1.1-org.freedesktop.portal.IBus@3.service: Failed with result ‘exit-code’.
2025-10-09T18:56:36.025017-04:00 themonster cosmic-comp[4846]: [GL] GL_INVALID_VALUE error generated. Size and/or offset out of range.
2025-10-09T18:56:43.323782-04:00 themonster cosmic-comp[4846]: Failed to handle X11 event
2025-10-09T18:56:48.801764-04:00 themonster cosmic-comp[4846]: [GL] GL_INVALID_VALUE error generated. Size and/or offset out of range.
2025-10-09T18:56:50.902263-04:00 themonster systemd[4753]: app-flatpak-com.getmailspring.Mailspring-104603997.scope: Consumed 1.465s CPU time.
2025-10-09T18:56:50.953128-04:00 themonster systemd[4753]: app-flatpak-com.getmailspring.Mailspring-2618097969.scope: Consumed 8.596s CPU time.

I was able to get to the bottom of this. These are the symptoms I saw:

  • “Mailspring could not store you password securely”
  • Electon logs: safeStorage.encryptString … Encryption is not available
  • On Wayland, the window sometimes launched but was invisible (no window on screen), even though processes were running

Root causes

  1. Keychain selection: Electron (which Mailspring uses) only enables encrypted storage if it can load libsecret and talk to a running org.freedesktop.secrets service. On COSMIC (not GNOME), because I am running this on Pop!_OS, Electron doesn’t always auto-pick the GNOME/libsecret backend.
  2. Windowing: On some GPUs/compositor combinations, Electron on Wayland can create a window that never becomes visible. Running under XWayland avoids that.

What I did

  • Switch to the native .deb build and removed the Flatpak I had running so it can reach the host keyring directly.
  • Verified the keyring service and libsecret runtime are present.
  • Launched Mailspring with environment vars that make Electron choose the GNOME/libsecret backend.
  • For the invisible window, I forced XWayland (–-ozone-platform=x11), which made the UI appear reliably.
  • Wrapped it all in a tiny launcher and desktop entry so it’s one click going forward.

If you run into these issues, here’s what you can try step by step:

  1. (Optional) Remove the Flatpak to prevent confusion, if you are running a Flatpak version.
flatpak uninstall -y com.getmailspring.Mailspring || true
  1. Install the native .deb by downloading it from the website and then run the following command
sudo apt install ./mailspring-*.deb
  1. Ensure keyring + libsecret are in place
sudo apt update
sudo apt install gnome-keyring seahorse libsecret-tools libsecret-1-0 gir1.2-secret-1
systemctl --user enable --now gnome-keyring-daemon.service

Here are a few health checks to run now:

# Secret service on D-Bus?
busctl --user list | grep org.freedesktop.secrets

# libsecret runtime visible to Electron?
ldconfig -p | grep libsecret-1.so.0

If you want to ensure that keyring actuall stores/restries a secret, you can run the following two commands to test:

secret-tool store --label="Test Secret" app mailspring-test key ping
secret-tool lookup app mailspring-test key ping   # should print: ping
  1. Launching Mailspring
env XDG_CURRENT_DESKTOP=GNOME DESKTOP_SESSION=gnome \
    ELECTRON_OZONE_PLATFORM_HINT=wayland \
    /usr/bin/mailspring --password-store=gnome

This eliminated my secure storage error. However, I had an issue where the Mailspring app wouldn’t show because I’m on Wayland. So I switched to XWayland by running this command:

env XDG_CURRENT_DESKTOP=GNOME DESKTOP_SESSION=gnome \
    ELECTRON_OZONE_PLATFORM_HINT=x11 \
    /usr/bin/mailspring --password-store=gnome \
    --ozone-platform=x11

This now shows the window reliably for Mailspring.

  1. Make a simple command to get things going moving forward:
sudo tee /usr/local/bin/mailspring-gnome >/dev/null <<'EOF'
#!/usr/bin/env bash
XDG_CURRENT_DESKTOP=GNOME \
DESKTOP_SESSION=gnome \
ELECTRON_OZONE_PLATFORM_HINT=x11 \
/usr/bin/mailspring --password-store=gnome \
  --ozone-platform=x11 "$@"
EOF

sudo chmod +x /usr/local/bin/mailspring-gnome
rehash  # zsh refresh
  1. Make the menu icon use the same flags:
mkdir -p ~/.local/share/applications
cp /usr/share/applications/Mailspring.desktop ~/.local/share/applications/
sed -i 's|^Exec=.*|Exec=env XDG_CURRENT_DESKTOP=GNOME DESKTOP_SESSION=gnome ELECTRON_OZONE_PLATFORM_HINT=x11 /usr/bin/mailspring --password-store=gnome --ozone-platform=x11 %U|' ~/.local/share/applications/mailspring.desktop
update-desktop-database ~/.local/share/applications

Verify that it’s done and working:

  • mailspring-gnome opens a visible window.
  • You don’t see the “could not store password securely” popup.
  • seahorse shows the Login keyring unlocked while Mailspring is running.

Optional things to add, if you’d like:

  • Ensure the keyring is always ready after login:
systemctl --user enable --now gnome-keyring-daemon.service
  • If Mailspring ever starts off the screen or black/invisible, run these:
pkill -f /usr/share/mailspring/mailspring
mv ~/.config/Mailspring/window-state.json{,.bak} 2>/dev/null || true
mv ~/.config/Mailspring/Bounds.json{,.bak} 2>/dev/null || true


If you want to try native Wayland later when things are more compatible, you can run the following:

env XDG_CURRENT_DESKTOP=GNOME DESKTOP_SESSION=gnome \
    ELECTRON_OZONE_PLATFORM_HINT=wayland \
    /usr/bin/mailspring --password-store=gnome \
    --enable-features=UseOzonePlatform,WaylandWindowDecorations \
    --ozone-platform=wayland

If it’s stable, swap those flags into your wrapper/desktop entry.


I hope this is helpful for anyone else out there.

Cheers!