Bug 455847 - "Share via email" doesn't work when there is no configured email client, and doesn't show the user an appropriate error message about it
Summary: "Share via email" doesn't work when there is no configured email client, and ...
Status: CONFIRMED
Alias: None
Product: frameworks-purpose
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 5.99.0
Platform: Neon Linux
: NOR major
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2022-06-23 13:44 UTC by Al Williams
Modified: 2025-01-24 14:06 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Error message (13.43 KB, image/png)
2025-01-24 13:18 UTC, Nicolas Fella
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Al Williams 2022-06-23 13:44:10 UTC
SUMMARY
***
When trying to send a scan, the program uses a mailto: link with a file-attachment. It looks like some common mail setups don't honor this anymore (especially web mail) presumably because it provides a way for someone to say "click here" and then mail themselves some file off your system without you noticing? 
***


STEPS TO REPRODUCE
1. Scan
2.  Send scan via e-mail
3.  Note that e-mail client pops up with no file attached

ADDITIONAL INFORMATION
As a silly work around, I have my e-mail application set to a file (/usr/local/bin/gmail-stub) that looks like this:

 #!/bin/bash
 CMD=`echo $1 | sed s/attachment=file:../subject=Please+attach+/`
 exec xdg-open "https://mail.google.com/mail?extsrc=mailto&url=$CMD"

This works for everything normal (the sed misses everything) and if you have an attachment you get a subject that says Please attach (file path). RFC2368 only assures you that to/subject/body are understood https://www.rfc-editor.org/rfc/rfc2368 -- I hear there is no more support in several other e-mail programs, too.

My script is not ideal, but I'm trying to think of a better way to do this for programs like skan. For example, copy the file to the clipboard so it could be pasted?
Comment 1 Alexander Stippich 2022-06-26 09:30:25 UTC
Does this only happen in Skanpage or also in other KDE software, e.g. Dolphin?
Comment 2 Nate Graham 2022-11-04 17:15:07 UTC
It'll happen in all apps since this uses the standard Purpose "share via email feature, which itself simply calls KIO::KEmailClientLauncherJob. When there's no email client app, it doesn't do the right thing. Moving to Purpose so we can at least show the user a reasonable error message.
Comment 3 Nicolas Fella 2025-01-24 13:18:25 UTC
Created attachment 177643 [details]
Error message

What's the right thing to do? 

I get an error message that says there are no email programs
Comment 4 Nate Graham 2025-01-24 14:06:21 UTC
Yeah, that sounds sane to me.