Bug 148508 - Information missing when sending email failed
Summary: Information missing when sending email failed
Status: RESOLVED DUPLICATE of bug 74067
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: All Linux (All)
: medium enhancement
Assignee: Not Assigned
URL: https://gitlab.freedesktop.org/xdg/xd...
Whiteboard:
Keywords:
Depends on:
Blocks: File-Send
  Show dependency treegraph
 
Reported: 2022-04-11 10:35 UTC by Heiko Tietze
Modified: 2022-07-08 07:14 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Patch showing all background jobs started from senddoc (2.33 KB, patch)
2022-04-12 12:06 UTC, Jan-Marek Glogowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Heiko Tietze 2022-04-11 10:35:04 UTC
File > Send > Email Document... (and other) uses /usr/bin/xdg-email to connect to the messenger. In my case it's Thunderbird on KDE. But due to a misconfiguration (see URL) this operation fails - and it does silently (except a warning in the console).

Jan-Marek, you might be interested in this issue.

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: d4e2ed9324bd736275f07577ba81c974a0a70eb1
CPU threads: 8; OS: Linux 5.17; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Jan-Marek Glogowski 2022-04-11 23:15:02 UTC
So the link tells me xdg-email had a bug with desktop files in the KDE case. That was fixed ~8 months ago. The last release of xdg-utils was 1.1.3 in 2018, roughly 4y ago. If I configure thunderbird in KDE as mail client, LO calls

/.../instdir/program/senddoc --mailclient 'thunderbird.desktop' --subject 'noname' --attach '/tmp/.../noname.odt'

That calls:
/usr/bin/xdg-email mailto:?subject=noname&attach=file:///tmp/lu6209365ngrly.tmp/lu6209365ngrm0.tmp/noname.odt &

That background job is a problem, because return codes from /usr/bin/xdg-email won't be handled this way.

Not sure anything else could be done here. Maybe implementing something like xdg-email's desktop_file_to_binary in senddoc would also help...

Nothing seems KDE specific in this bug.
Comment 2 Michael Weghorn 2022-04-12 07:21:03 UTC
Explicitly setting the email program in "Tools" -> "Options" -> "Internet" -> "Email" to "thunderbird" can be used at least as a workaround.

("thunderbird.desktop" is shown by default when that's set as default program in KDE's systemsettings.)
Comment 3 Heiko Tietze 2022-04-12 10:18:28 UTC
(In reply to Jan-Marek Glogowski from comment #1)
> That was fixed ~8 months ago. The last release of xdg-utils was 1.1.3 in
> 2018, roughly 4y ago. 

I'm on Arch Linux and update regularly. NOB, of course. But the point is that external programs may fail and do so silently.

(In reply to Michael Weghorn from comment #2)
> Explicitly setting the email program...can be used at least as a workaround.

Good to know, could be helpful if we show a messagebox that something went wrong.
Comment 4 Jan-Marek Glogowski 2022-04-12 12:06:43 UTC
Created attachment 179487 [details]
Patch showing all background jobs started from senddoc

(In reply to Heiko Tietze from comment #3)
> (In reply to Jan-Marek Glogowski from comment #1)
> > That was fixed ~8 months ago. The last release of xdg-utils was 1.1.3 in
> > 2018, roughly 4y ago. 
> 
> I'm on Arch Linux and update regularly. NOB, of course. But the point is
> that external programs may fail and do so silently.
> 
> (In reply to Michael Weghorn from comment #2)
> > Explicitly setting the email program...can be used at least as a workaround.
> 
> Good to know, could be helpful if we show a messagebox that something went
> wrong.

LO does show a message box, if either the command is not available (popen fails), or the command returns an exit code != 0. But many programs would block LO execution (see the attached patch), so these run in the background and therefore don't report an exit code to LO.

A better solution would be to start a thread to run senddoc (and a nested event loop or async result reporting), so the attached patch can be applied and LO wouldn't block. None of it is KDE specific, except for the original thunderbird.desktop NOB problem.
Comment 5 Timur 2022-07-07 13:21:30 UTC
Can we put this a duplicate of Bug 116211 or maybe better bug 74067 ?
Comment 6 Heiko Tietze 2022-07-08 07:14:59 UTC

*** This bug has been marked as a duplicate of bug 74067 ***