Need an xdg-email wrapper, similar to the xdg-open one

Bug #1863625 reported by Olivier Tilloy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Triaged
Medium
James Henstridge

Bug Description

The chromium snap has some magic to symlink /usr/bin/xdg-email to /usr/bin/xdg-open to work around bug #1849774. This is because chromium invokes xdg-email when a mailto: hyperlink is clicked.

That magic works in most cases because xdg-open generally knows how to handle mailto: links, but apparently there are corner cases where it doesn't, which is why xdg-email should be used (see https://bugs.chromium.org/p/chromium/issues/detail?id=61942).

I suppose chromium is not an isolated case, other applications might want to call xdg-email to offer users to compose a new e-mail with their preferred e-mail client.

Can snapd expose an xdg-email wrapper (that would accept only mailto: links), similar to the existing xdg-open wrapper?

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Without knowing more about the problem, would using the existing xdg-open program for xdg-mail? Currently the xdg-open program inside snap mount namespace does support mailto: URL scheme. Could we simply provide a symlink from xdg-mail to xdg-open?

Changed in snapd:
status: New → Incomplete
Revision history for this message
Olivier Tilloy (osomon) wrote :

This would work in the general case, but not always. xdg-open special-cases some well-known desktop environment (e.g. GNOME, KDE, XFCE), and for those it would work. But other more obscure DEs may not expose what xdg-open needs to handle mailto: links, which I guess is why xdg-email exists in the first place. There are details in the chromium bug I shared in the description.

So symlinking xdg-open to xdg-email would definitely be an improvement over the existing situation, but not a complete solution.

Changed in snapd:
status: Incomplete → New
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I understand. I will raise this topic with the desktop team.

Revision history for this message
James Henstridge (jamesh) wrote :

From a look at the xdg-email man page, it looks like it maps fairly well to the org.freedesktop.portal.Email.ComposeEmail method call.

Given that we want to switch the sandbox xdg-open over to preferring the xdg-desktop-portal API over userd, I think an xdg-email proxy should target the portal API exclusively rather than add a new userd API.

Changed in snapd:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → James Henstridge (jamesh)
Revision history for this message
James Henstridge (jamesh) wrote :

One thing that would be worth trying from the sandbox side: the flatpak-xdg-utils package contains an implementation of xdg-email that calls into xdg-desktop-portal. Any xdg-email proxy provided to snaps would look very similar to this.

Flatpak-xdg-utils is not packaged in xenial or bionic, but it looks like it would be fairly simple to build from source within e.g. the Chromium snap:

https://github.com/flatpak/flatpak-xdg-utils

Revision history for this message
James Henstridge (jamesh) wrote :

On further investigation, this probably isn't suitable for Chromium (yet), since it doesn't seem to support mailto: URIs yet:

https://github.com/flatpak/flatpak-xdg-utils/issues/19

Revision history for this message
Ian Johnson (anonymouse67) wrote :

The associated flatpak-xdg-utils issue was closed, perhaps the chromium snap can start building that now?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.