Bug 455847

Summary: "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
Product: [Frameworks and Libraries] frameworks-purpose Reporter: Al Williams <alw>
Component: generalAssignee: Aleix Pol <aleixpol>
Status: CONFIRMED ---    
Severity: major CC: nate, nicolas.fella
Priority: NOR Keywords: usability
Version First Reported In: 5.99.0   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Error message

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.