Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xdg-email doesn't seem to support mailto: URLs #19

Closed
smcv opened this issue Jan 17, 2019 · 3 comments · Fixed by #32
Closed

xdg-email doesn't seem to support mailto: URLs #19

smcv opened this issue Jan 17, 2019 · 3 comments · Fixed by #32

Comments

@smcv
Copy link
Contributor

smcv commented Jan 17, 2019

The reference xdg-email(1) is documented as accepting these as equivalent:

xdg-email --subject="Make Money Fast" --body="Spam" me@example.com
xdg-email "mailto:me@example.com?subject=Make%20Money%20Fast&body=Spam"

but I don't see any code in xdg-email to handle the latter.

@matthiasclasen
Copy link
Contributor

Do you know of users in the wild using a mailto: url for xdg-email ?

@smcv
Copy link
Contributor Author

smcv commented Jan 17, 2019

The documentation and --help were my only reference, but https://codesearch.debian.net/search?q=xdg-email.*mailto%3A says jami (formerly ring) also uses mailto:.

@jhenstridge
Copy link

For what it is worth, Chromium also calls xdg-email with a mailto: URI:

https://github.com/chromium/chromium/blob/master/chrome/browser/platform_util_linux.cc#L187

So that probably extends to some Electron apps too.

smcv added a commit to smcv/flatpak-xdg-utils that referenced this issue Aug 1, 2020
The reference xdg-email shell script documents that it supports mailto:
URIs, and it appears that at least Chromium and Jami (formerly GNU Ring)
genuinely make use of that feature.

If the only non-ignored argument is a mailto: URI, we pass it
directly to the OpenURI portal without further processing. This mode
can be used by applications wishing to do tricky things with headers
that we don't directly support.

Otherwise, we parse the mailto: URI and extract the header, subject
and addresses. Other headers are ignored.

The reference xdg-email script only accepts one mailto: URI, but
accepting more than one is actually easier than not, so we do that.

Resolves: flatpak#19
Signed-off-by: Simon McVittie <smcv@collabora.com>
smcv added a commit to smcv/flatpak-xdg-utils that referenced this issue Aug 1, 2020
The reference xdg-email shell script documents that it supports mailto:
URIs, and it appears that at least Chromium and Jami (formerly GNU Ring)
genuinely make use of that feature.

If the only non-ignored argument is a mailto: URI, we pass it
directly to the OpenURI portal without further processing. This mode
can be used by applications wishing to do tricky things with headers
that we don't directly support.

Otherwise, we parse the mailto: URI and extract the header, subject
and addresses. Other headers are ignored.

The reference xdg-email script only accepts one mailto: URI, but
accepting more than one is actually easier than not, so we do that.

Resolves: flatpak#19
Signed-off-by: Simon McVittie <smcv@collabora.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants