Summary: | Setting a custom mail client has no effect on mailto | ||
---|---|---|---|
Product: | [Applications] systemsettings | Reporter: | Christopher Yeleighton <giecrilj> |
Component: | kcm_componentchooser | Assignee: | Unassigned bugs mailing-list <unassigned-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | adaptee, aleixpol, alex, bugseforuns, crazylegoguy, dvratil, faure, fellype, ftefrjbhfvasf32, jirislaby, kaigue7, kde, kde, kde, langec, m.wege, meven29, montel, nate, P.Suetterlin, psychonaut, szykcech, thiago.bauermann |
Priority: | HI | Keywords: | usability |
Version: | 4.9.0 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | https://cgit.kde.org/plasma-desktop.git/commit/?id=d1f62c16c878a665c6e548f7a99b6fab21882e6d | Version Fixed In: | 5.19.0 |
Sentry Crash Report: |
Description
Christopher Yeleighton
2012-01-27 16:39:26 UTC
Same here. Interestingly the mail client setting in the component chooser is respected when I run xdg-email mailto:bugzilla_noreply@kde.org but it is not respected by KRunner, Konqueror, nor by xdg-open. I can confirm the issue in comment #1 is easy to reproduce in KDE SC 4.9 (In reply to comment #2) > I can confirm the issue in comment #1 is easy to reproduce in KDE SC 4.9 Indeed even 4.9.1. Sorry, forgot to report the version in my previous comment. This is still the case in 3.12.4. xdg-open/kde-open mailto:x@y.com still does not open the preferred application. According to strace of the process I see: execve("/usr/bin/thunderbird", ["/usr/bin/thunderbird", "%s", ""], [/* 95 vars */]) = 0 Where does this come from? I have set %u in the system settings... And why is not the string %s replaced by subject? The command used: strace -fe execve kde-open mailto:x@y.com Turning on debug just shows this: unnamed app(1501) ClientApp::doIt: Creating ClientApp kioclient(1501) ClientApp::kde_open: KUrl("mailto:x@y.com") kioclient(1501)/kio (KRun) KRun::slotTimeout: KRun(0x1eee590) slotTimeout called kioclient(1501)/kio (KRun) KRun::init: INIT called kioclient(1501)/kdecore (KSycoca) KSycocaPrivate::openDatabase: Trying to open ksycoca from "/var/tmp/kdecache-xslaby/ksycoca4" kioclient(1501)/kio (KRun) KRun::init: Helper protocol kioclient(1501)/kfile (kdelibs) KRecentDocument::add: KRecentDocument::add for "mailto:x@y.com" kioclient(1501)/kio (KRun) runTempService: runTempService: first url "mailto:x@y.com" kioclient(1501)/kio (KRun) runTempService: runTempService: KProcess args= ("/usr/bin/thunderbird", "%s", "") kioclient(1501)/kdecore (KStartupInfo) KStartupInfo::createNewStartupId: creating: "anemoi;1399886695;787775;1501_TIME0" : "" kioclient(1501)/kdecore (KStartupInfo) KStartupInfo::sendStartup: sending "new: ID="anemoi;1399886695;787775;1501_TIME0" BIN="thunderbird" DESCRIPTION="Spouštím " DESKTOP=2 WMCLASS="0" HOSTNAME=anemoi NAME="thunderbird" SCREEN=0" kioclient(1501)/kdecore (KStartupInfo) KStartupInfo::sendChange: sending "change: ID="anemoi;1399886695;787775;1501_TIME0" PID=1504" kioclient(1501)/kio (KRun) KRun::slotTimeout: KRun(0x1eee590) slotTimeout called (process:1504): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed kioclient(1501)/kio (KRun) KProcessRunner::slotProcessExited: "/usr/bin/thunderbird" exitCode= 0 exitStatus= 0 kioclient(1501)/kdecore (KStartupInfo) KStartupInfo::sendFinish: sending "remove: ID="anemoi;1399886695;787775;1501_TIME0" HOSTNAME=anemoi PID=1504" I had the same problem. It was set to evolution, which I don't have installed (haven't used it in years). Very annoying since because of this bug KMail tries to launch evolution when using the mailing list options in the menu, such as Message → Mailing list → Unsubscribe (email). I found out that I had the following entries in ~/.local/share/applications/mimeapps.list: x-scheme-handler/mailto=userapp-Evolution-8XCMWV.desktop; x-scheme-handler/mailto=userapp-Evolution-8XCMWV.desktop I have that file in the same directory: hactar·⚡ cat ~/.local/share/applications/userapp-Evolution-8XCMWV.desktop [Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Application Exec=evolution --component=mail %u Name=Evolution Comment=Custom definition for Evolution NoDisplay=true After removing the x-scheme-handler lines from mimeapps.list, it finally works! (In reply to Thiago Jung Bauermann from comment #6) > After removing the x-scheme-handler lines from mimeapps.list, it finally > works! Yes, it indeed does. Thanks a lot! Confirming this bug still exists in System Settings 5.7.4. The e-mail client I specify isn't launched when I follow a link to a mailto: URL from an application. Contrary to Comment #1, xdg-email also doesn't launch the correct e-mail client. xdg-open and kde-open also don't work correctly for mailto: URLs. Jiri, how did you "turn on debug" to get the output you posted in Comment #5? I would like to try the same thing. In the meantime, does anyone have a workaround? (In reply to Tristan Miller from comment #9) > Jiri, how did you "turn on debug" to get the output you posted in Comment > #5? I would like to try the same thing. Via kdebugdialog. After logging out and back in again, xdg-email and xdg-open now work properly. However, kde-open still opens mailto: URLs in KMail. Turning on all debugging output via kdebugdialog shows kioclient attempting to launch KMail, not the third-party e-mail program I specified in System Settings: $ kde-open mailto:x@y.com unnamed app(1503) ClientApp::doIt: Creating ClientApp kioclient(1503) ClientApp::kde_open: KUrl("mailto:x@y.com") kioclient(1503)/kio (KRun) KRun::slotTimeout: KRun(0x1714430) slotTimeout called kioclient(1503)/kio (KRun) KRun::init: INIT called kioclient(1503)/kdecore (KSycoca) KSycocaPrivate::openDatabase: Trying to open ksycoca from "/var/tmp/kdecache-psy/ksycoca4" kioclient(1503)/kio (KRun) KRun::init: Helper protocol kioclient(1503)/kfile (kdelibs) KRecentDocument::add: KRecentDocument::add for "mailto:x@y.com" kioclient(1503)/kio (KRun) runTempService: runTempService: first url "mailto:x@y.com" kioclient(1503)/kio (KRun) supportedProtocols: supportedProtocols: ("KIO") kioclient(1503)/kio (KRun) runTempService: runTempService: KProcess args= ("/usr/bin/kmail", "-qwindowtitle", "", "mailto:x@y.com") kioclient(1503)/kdecore (KStartupInfo) KStartupInfo::createNewStartupId: creating: "ferret.nothingisreal.com;1476024386;317165;1503_TIME0" : "" kioclient(1503)/kdecore (KStartupInfo) KStartupInfo::sendStartup: sending "new: ID="ferret.nothingisreal.com;1476024386;317165;1503_TIME0" BIN="kmail" DESCRIPTION="Launching " DESKTOP=0 WMCLASS="0" HOSTNAME=ferret.nothingisreal.com NAME="kmail" SCREEN=0" kioclient(1503)/kdecore (KStartupInfo) KStartupInfo::sendChange: sending "change: ID="ferret.nothingisreal.com;1476024386;317165;1503_TIME0" PID=1505" kioclient(1503)/kio (KRun) KRun::slotTimeout: KRun(0x1714430) slotTimeout called Problem still exists with System Settings 5.9.4. *** This bug has been marked as a duplicate of bug 360073 *** *** Bug 360073 has been marked as a duplicate of this bug. *** *** Bug 369394 has been marked as a duplicate of this bug. *** *** Bug 373993 has been marked as a duplicate of this bug. *** *** Bug 379901 has been marked as a duplicate of this bug. *** *** Bug 398246 has been marked as a duplicate of this bug. *** *** Bug 400608 has been marked as a duplicate of this bug. *** Unlike Bug 350663, this one seems a lot tricker. Here are the results of my investigation tonight: Selecting "Use different email client" in the KCM and entering some text there results in ~/.config/emaildefaults being updated: it adds or updates EmailClient[$e]=<the text you entered>. This is very reliable and happens 100% of the time. This ~/.config/emaildefaults file seems to be something KDE-specific: https://cgit.kde.org/kconfig.git/tree/src/core/kemailsettings.cpp#n228. It appears to be read in only one place: https://cgit.kde.org/kservice.git/tree/src/kdeinit/ktoolinvocation_x11.cpp#n132, but that invokeMailer function is used all over the place: https://lxr.kde.org/search?_filestring=&_string=invokeMailer However, somehow nothing set in that file actually seems to be getting used; mailto: links totally ignore it. ~/.config/mimeapps.list also stores information on the default mailto: handler. The [Default Applications] section always seems to have x-scheme-handler/mailto=org.kde.kmail.desktop;. This can be overridden in the [Added Associations] section. Mine has x-scheme-handler/mailto=thunderbird.desktop; in there. It seems that Thunderbird added itself there when it asked whether or not it could be the default email client and was told yes. The config data stored there seems to take precedence over ~/.config/emaildefaults. This feels fragile. Conceptually, it seems like we might want to deprecate ~/.config/emaildefaults and just rely on ~/.config/mimeapps.list, which is a cross-desktop standard. All the functionality is still there via the apps' desktop files. Also, when an app implements its own "do you want to make me the default program?" UI, it will update the shared config data so the KCM can update its own UI display automatically, rather than the two drifting out of sync and making the KCM inaccurate, which is what's happened here. Does any of this make sense? I'd very much appreciate if someone of a more veteran KDE tenure could let me know if I'm on the right or wrong track here. I CCd a bunch of you, hope you don't mind! Probably needs something similar to what I did in https://phabricator.kde.org/D17371 *** Bug 405374 has been marked as a duplicate of this bug. *** *** Bug 410278 has been marked as a duplicate of this bug. *** *** Bug 411242 has been marked as a duplicate of this bug. *** I completely agree with you Nate : we should deprecate (if not completely remove) ~/.config/emaildefaults and use only ~/.config/mimeapps.list to store the default mail client and probably Deprecate/Remove KEMailSettings at term. It is used in componentchooser, takstools.cpp and KMail. I had a look at the latest duplicated bugs, and it is a mixed bag: - The original bug was about mailto support in KRunner only using kmail. I believe krunner has had no support for mailto for some time. Probably around the time of 2016-04-22 "Remove kmailservice5, it can only do harm at this point." https://cgit.kde.org/kio.git/commit/?id=2e6980e9ba3b91798dad0db9f9d78317b2d7e4a2 . And this will need to get fixed. - Some are about "Send via Email" not using the set default application. It seems to work in master at least, but lack working "attach file" with any other email client than kmail. I am afraid we would need specific code for each email client, gnome handles this via scripts : https://ubuntuswitch.wordpress.com/2007/07/09/howto-use-mozilla-thunderbird-in-nautilus-send-to-instead-of-evolution-for-attachments/ - https://bugs.kde.org/show_bug.cgi?id=411242 https://bugs.kde.org/show_bug.cgi?id=410278 are about the componentchooser UI not working properly : I am working on it. I'd like to simplify the UI to only allow to select applications with a desktop file associated with the mimetype "x-scheme-handler/mailto", sort of like we do for the browser chooser since https://phabricator.kde.org/D26100 with "x-scheme-handler/http"/"x-scheme-handler/https" (as does gnome https://gitlab.gnome.org/GNOME/gnome-control-center/blob/master/panels/default-apps/cc-default-apps-panel.c#L155). There is a first patch https://phabricator.kde.org/D26559 that will update the cached email client and make the setting instantly taken into account. This was just fixed for Plasma 5.19! |