KDE-Kontact unable to send E-Mail. Failed to get D-Bus interface of mailfilteragent

Hello

To my surprise, I am not able to send E-Mail using Kontact.

image

I tried akonadictl restartseveral times as well as rebooting, no effect.

I am running NixOS and believe I am on the newest stable channel:

# nix-channel --list
nixos https://channels.nixos.org/nixos-26.05

Receiving works.

These are the kontakt related packages i have installed:

pkgs.kdePackages.kontact
pkgs.kdePackages.akonadiconsole
pkgs.kdePackages.kcalc
pkgs.kdePackages.kmail-account-wizard

I looked around in akonadiconsolebut nothing caught my eye (might be because I do not know what I am looking for).

Here is all new journalctl --user --follow output from me opening the test mail and then trying to send:

sep 14 08:50:12 nixos akonadiserver[11238]: ItemRetrievalJob for request 24665 finished
sep 14 08:50:12 nixos akonadiserver[11238]: ItemRetrievalJob for request 24667 finished
sep 14 08:50:12 nixos akonadiserver[11238]: ItemRetrievalJob for request 24668 finished
sep 14 08:50:12 nixos akonadiserver[11238]: Executing search "kontact-4158396249-SearchSession"
sep 14 08:50:12 nixos akonadiserver[11238]: Search  "kontact-4158396249-SearchSession" done (without remote search)
sep 14 08:50:12 nixos akonadiserver[11238]: ItemRetrievalJob for request 24669 finished
sep 14 08:50:12 nixos akonadiserver[11238]: ItemRetrievalJob for request 24670 finished
sep 14 08:50:13 nixos akonadiserver[11238]: ItemRetrievalJob for request 24671 finished
sep 14 08:50:13 nixos akonadiserver[11238]: ItemRetrievalJob for request 24672 finished
sep 14 08:50:13 nixos akonadiserver[11238]: ItemRetrievalJob for request 24673 finished
sep 14 08:50:13 nixos akonadiserver[11238]: ItemRetrievalJob for request 24674 finished
sep 14 08:50:13 nixos akonadiserver[11238]: ItemRetrievalJob for request 24675 finished
sep 14 08:50:13 nixos akonadiserver[11238]: Handler exception when handling command FetchItems on connection kontact-4158396249 (0x5ce768141e80) : Item query returned empty result set
sep 14 08:50:13 nixos akonadiserver[11238]: Handler exception when handling command FetchItems on connection kontact-4158396249 (0x5ce768141e80) : Item query returned empty result set
sep 14 08:50:13 nixos akonadiserver[11238]: Handler exception when handling command FetchItems on connection kontact-4158396249 (0x5ce768141e80) : Item query returned empty result set
sep 14 08:50:13 nixos akonadiserver[11238]: Handler exception when handling command FetchItems on connection kontact-4158396249 (0x5ce768141e80) : Item query returned empty result set
sep 14 08:50:13 nixos akonadiserver[11238]: Handler exception when handling command FetchItems on connection kontact-4158396249 (0x5ce768141e80) : Item query returned empty result set
sep 14 08:50:14 nixos akonadiserver[11238]: Executing search "kontact-4158396249-SearchSession"
sep 14 08:50:14 nixos akonadiserver[11238]: Search  "kontact-4158396249-SearchSession" done (without remote search)
sep 14 08:50:14 nixos akonadiserver[11238]: ItemRetrievalJob for request 24676 finished
sep 14 08:50:14 nixos plasmashell[2026]: qrc:/qt/qml/plasma/applet/org/kde/plasma/notifications/global/Globals.qml:575:17: Unable to assign QString to int
sep 14 08:50:14 nixos akonadiserver[11238]: ItemRetrievalJob for request 24678 finished
sep 14 08:50:14 nixos akonadi_maildispatcher_agent[11289]: Failed to notify "Created too many similar notifications in quick succession"
sep 14 08:50:14 nixos akonadi_maildispatcher_agent[11289]: Failed to notify "Created too many similar notifications in quick succession"
sep 14 08:50:15 nixos plasmashell[2026]: Final member StackingOrder is overridden in class QQmlDMAbstractItemModelData. The override won't be used.
sep 14 08:50:15 nixos plasmashell[2026]: Final member StackingOrder is overridden in class QQmlDMAbstractItemModelData. The override won't be used.
sep 14 08:50:15 nixos plasmashell[2026]: Final member StackingOrder is overridden in class QQmlDMAbstractItemModelData. The override won't be used.

Looks fine to me. Not sure how to troubleshoot this further…

Found what seems to be an older troubleshooting guide: Your Emails Are Not Being Sent, Without Error Messages , advising to restart the Mail Dispatcher Agent in the akonadiconsole Agents tab. Tried that for good measure. It also talks about restarting if there is a problem with dbus, that does obviously not fix the issue.

This KDE troubelshooting guide Troubleshooting - KDE Community Wiki advices to look at journalctl --boot 0 --no-pager. A long read later, I found this:

sep 15 04:19:09 nixos akonadi_maildispatcher_agent[3349]: Failed to register with host portal QDBusError("org.freedesktop.portal.Error.Failed", "Could not register app ID: App info not found for 'org.kde.akonadi_maildispatcher_agent'")

Not sure what to make of it though. Seraching online, this seems to be mostly relevant for apps that are meant to be started by the user as standalone programs. Might be misunderstanding this.

A bit later in the boot log:

sep 15 04:19:09 nixos akonadi_control[3034]: Agent instance (agentInstanceAccountId)  "akonadi_maildispatcher_agent"  has no agent account interface.
sep 15 04:19:09 nixos akonadi_control[3034]: Agent instance (agentInstanceAccountId)  "akonadi_maildispatcher_agent"  has no agent account interface.
sep 15 04:19:09 nixos akonadi_control[3034]: Agent instance (agentInstanceAccountId)  "akonadi_newmailnotifier_agent"  has no agent account interface.
sep 15 04:19:09 nixos akonadi_control[3034]: Agent instance (agentInstanceAccountId)  "akonadi_maildispatcher_agent"  has no agent account interface.
sep 15 04:19:09 nixos akonadi_control[3034]: Agent instance (agentInstanceAccountId)  "akonadi_maildispatcher_agent"  has no agent account interface.
sep 15 04:19:09 nixos akonadi_control[3034]: Agent instance (agentInstanceAccountId)  "akonadi_maildispatcher_agent"  has no agent account interface.
sep 15 04:19:09 nixos akonadi_control[3034]: Agent instance (agentInstanceAccountId)  "akonadi_newmailnotifier_agent"  has no agent account interface.
sep 15 04:19:09 nixos akonadi_control[3034]: Agent instance (agentInstanceAccountId)  "akonadi_maildispatcher_agent"  has no agent account interface.
sep 15 04:19:09 nixos akonadi_control[3034]: Agent instance (agentInstanceAccountId)  "akonadi_maildispatcher_agent"  has no agent account interface.
sep 15 04:19:09 nixos akonadi_control[3034]: Agent instance (agentInstanceAccountId)  "akonadi_birthdays_resource"  has no agent account interface.
sep 15 04:19:09 nixos akonadi_control[3034]: Agent instance (agentInstanceAccountId)  "akonadi_maildispatcher_agent"  has no agent account interface

has no agent account interface. → because is has a dbus interface like all the other (mostly not shown) Agent instances?

Tried the following:

  • Boot into OpenSuse Tumbleweed, sending works, not a problem with my mail provider.
  • Boot into a the last 25.11 (i belive) generation. Same issue.
  • Ran nixos-rebuild switch --upgrade and rebooted. E-mail not send, no error message, no new information in journalctl --follow. Piping journalctl --boot 0 --no-pager | less and searching for maildispatcher does not give me anything new.

Next, trying to reinstall NixOS. Maybe I introduced issues by copying the complete home folder over from an OpenSUSE Tumbleweed installation. Not sure if dot-folders where copied too, but this is my best guess currently.

Writing this from the fresh install, same issue…

Will go back to the other installation, copying the home folder was obviously not the problem.

I started to get this window, after a fresh boot, not sure if I just overlooked this before or it wasn’t there.

Clicking on Set Online triggers the Failed to get D-Bus interface of mailfilteragent. notification.

Maybe also try installing the main kmail package? pkgs.kdePackages.kmail

Thank you very much. That did it. I would never have guessed. Do you know if this is as intended or should I file a bug report somewhere?

I don’t think this is a bug, kontact tries to find some application that can send an email through dbus and can’t find it, makes sense that results in an error. It is quite common DE applications are quite tightly coupled and have dependencies on each other (especially in kde and gnome)

As a non-kontact user, I’d be curious if kontact would work if installed using

programs.kde-pim = {
    enable = true;
    kontact = true;
};

instead of direct manipulation of environment.systemPackages. There is a general pattern of onboarding people newer to NixOS where there is some programs.* or services.* option that is missed that makes things easier, and maybe that is happening here.

Hence my surprise, but i think @withakay is on to something:

… I’d be curious if kontact would work if installed using

programs.kde-pim = {
    enable = true;
    kontact = true;
};

I tried this and it leads to the same D-Bus error again: Failed to get D-Bus interface of mailfilteragent. Would I be able to ask you where you found this or how more documentation could be accessed? This certainly seems like the correct path. Just installing kmail in addition to the above does however solved the issue again.

I searched for “kontact” in man configuration.nix or nixos-help (appendix A) or https://search.nixos.org/options. There are also ways to get there through nixos-option, nix repl and grepping the nixpkgs source.

If a “working” kontact should be able to send mail, and the programs.kde-pim.* snippet above doesn’t get there, then on initial glance that does seem like a bug to me either in implementation or docs of the programs.kde-pim.* tree. Again, not a kontact user so it’s hard for me to judge.

Ok, so the the man page for configuration.nix has over 385 thousand lines :anxious_face_with_sweat:. I found the options in there, great resource. Will have a look at the other options as i go.

Kontact has a menu to configure Kmail, even when Kmail was not installed… I can see both sides of the argument here. To raise this further, the pim part technically does not need a mail sending client. However, it feels to me Kontact is not intended to run without Kmail. I understand, to bring this up, one needs a github account, which i have trouble with due to it not seeming to accept startmail aliases.

The good news is, others having the same should easily thing this thread and the excellent help herein.

On that note, thank you very much for your help again.

Edit:

Found it, there is a kmail option: NixOS Search . I confirm that this works:

programs.kde-pim = {
  enable = true;
  kmail = true;
  kontact = true;
};