LO unable to find a working email configuration

Bug #1748895 reported by cement_head
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
LibreOffice
Confirmed
Medium
libreoffice (Ubuntu)
Fix Released
Medium
Olivier Tilloy

Bug Description

Installed from PPA: ppa:libreoffice/ppa

$ lsb_release -a
LSB Version: core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:printing-9.20160110ubuntu0.2-amd64:printing-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial

$ apt-cache policy libreoffice
libreoffice:
  Installed: 1:6.0.1~rc1-0ubuntu0.16.04.1~lo1
  Candidate: 1:6.0.1~rc1-0ubuntu0.16.04.1~lo1
  Version table:
 *** 1:6.0.1~rc1-0ubuntu0.16.04.1~lo1 500
        500 http://ppa.launchpad.net/libreoffice/ppa/ubuntu xenial/main amd64 Packages
        100 /var/lib/dpkg/status
     1:5.1.6~rc2-0ubuntu1~xenial2 500
        500 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu xenial-security/universe amd64 Packages
     1:5.1.2-0ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages

WHAT YOU EXPECT TO HAPPEN:

  Should spawn an new Evolution eMAIL with attached ODF document

WHAT HAPPENED INSTEAD:

  Error Dialogue: LibreOffice is unable to find a working email configuration. Please save your document locally and attached from within your eMAIL client.

CVE References

Revision history for this message
Olivier Tilloy (osomon) wrote :

Confirmed. This appears to be a regression. I can observe the issue in xenial and bionic, where the functionality used to work as expected in previous versions (5.1.6 and 5.4.3, respectively).

Changed in libreoffice (Ubuntu):
status: New → Confirmed
Revision history for this message
Olivier Tilloy (osomon) wrote :

And the following error is most likely related:

    sh: 1: /usr/lib/libreoffice/program/senddoc: Permission denied

Revision history for this message
Olivier Tilloy (osomon) wrote :

Indeed, if I unload the apparmor profile for soffice.bin, sending the current document as e-mail attachment works again.

Revision history for this message
Olivier Tilloy (osomon) wrote :

Corresponding apparmor entry in journalctl:

audit[1608]: AVC apparmor="ALLOWED" operation="exec" info="profile transition not found" error=-13 profile="libreoffice-soffice" name="/usr/lib/libreoffice/progrm/senddoc" pid=1608 comm="sh" requested_mask="x" denied_mask="x" fsuid=1000 ouid=0 target="/usr/lib/libreoffice/program/senddoc"

Revision history for this message
Bryan Quigley (bryanquigley) wrote :

The senddoc profile is wrong like the other one was too -
profile libreoffice-senddoc /usr/lib/libreoffice//usr/lib{,32,64}/libreoffice/program/senddoc {
  #include <abstractions/base>

It still seems like the profile is missing xdg-email, which might be needed too.

Revision history for this message
Olivier Tilloy (osomon) wrote :

The path to the senddoc executable is incorrect in the apparmor profile:

  $ grep profile /etc/apparmor.d/usr.lib.libreoffice.program.senddoc
  profile libreoffice-senddoc /usr/lib/libreoffice//usr/lib{,32,64}/libreoffice/program/senddoc {

After fixing it and reloading the profile though, I'm seeing another issue:

  /usr/lib/libreoffice/program/senddoc: 442: /usr/lib/libreoffice/program/senddoc: /usr/bin/xdg-email: Permission denied

Olivier Tilloy (osomon)
Changed in libreoffice (Ubuntu):
assignee: nobody → Olivier Tilloy (osomon)
importance: Undecided → Medium
Revision history for this message
Olivier Tilloy (osomon) wrote :
Changed in libreoffice (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Olivier Tilloy (osomon) wrote :
Changed in libreoffice (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libreoffice - 1:5.4.5-0ubuntu0.17.10.1

---------------
libreoffice (1:5.4.5-0ubuntu0.17.10.1) artful; urgency=medium

  * New upstream release (LP: #1748999)
    - fixes CVE-2018-6871: Remote arbitrary file disclosure vulnerability via
      WEBSERVICE formula
  * debian/patches/apparmor-senddoc-fixes.patch: apparmor fixes for the
    senddoc profile (LP: #1748895)

 -- Olivier Tilloy <email address hidden> Tue, 13 Feb 2018 11:25:01 +0100

Changed in libreoffice (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
cement_head (andorjkiss) wrote :

Still in LO 6.0.x

Revision history for this message
David van der Wal (statitica) wrote :

Still present with LO6 and Thunderbird on Ubuntu 16.04.03

Revision history for this message
Olivier Tilloy (osomon) wrote :

Which version exactly? Can you please share the output of:

    apt policy libreoffice-common

Revision history for this message
David van der Wal (statitica) wrote :

apt policy libreoffice-common
libreoffice-common:
  Installed: 1:6.0.1~rc1-0ubuntu0.16.04.1~lo1
  Candidate: 1:6.0.1~rc1-0ubuntu0.16.04.1~lo1
  Version table:
 *** 1:6.0.1~rc1-0ubuntu0.16.04.1~lo1 500
        500 http://ppa.launchpad.net/libreoffice/ppa/ubuntu xenial/main amd64 Packages
        500 http://ppa.launchpad.net/libreoffice/ppa/ubuntu xenial/main i386 Packages
        100 /var/lib/dpkg/status
     1:5.1.6~rc2-0ubuntu1~xenial3 500
        500 http://au.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        500 http://au.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages
        500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu xenial-security/main i386 Packages
     1:5.1.2-0ubuntu1 500
        500 http://au.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
        500 http://au.archive.ubuntu.com/ubuntu xenial/main i386 Packages

Revision history for this message
Olivier Tilloy (osomon) wrote :

This is fixed in libreoffice 6.0.1 in ubuntu 18.04, and will be fixed in the next update in the PPA for 16.04 (6.0.2).

Revision history for this message
cement_head (andorjkiss) wrote :

Nope. Still broken.

$ soffice
/usr/lib/libreoffice/program/senddoc: 277: /usr/lib/libreoffice/program/senddoc: /usr/bin/evolution: Permission denied

Revision history for this message
Rico Tzschichholz (ricotz) wrote :

Please try to unset your email-client inside of libreoffice settings, and rely on the system-wide setting which can be made in e.g. gnome-control-center

Revision history for this message
cement_head (andorjkiss) wrote :

Okay, works now if </usr/bin/evolution> is deleted and client is left <blank>

Revision history for this message
In , Bernard Moreton (bernard-moreton-1) wrote :

Description:
When tools/options/internet/email is set to /usr/bin/claws-mail, send by email fails. If it's unsert, to allow a default of xdg-email, it still fails, and if it's explicitly set to /usr/bin/xdg-email it still does not work. Trying to Send now leaves me in limbo, somewhere between LO and my email client (Claws), with neither having focus, so alt-tab gets me nowhere until I manually reassert focus on one or the other.
Build ID: 1:6.0.2~rc1-0ubuntu0.16.04.1~lo1
on Ubunto 16.04.4 LTS

Help (on tools/options/internet/email) is not at all helpful,
and Browse isn't either - on my system it includes claws-mail.

If I select xdg-email, then I get the same result s for Claws.
xdg-email --attach <FILE> works fine for me from the command line.

If AppArmor has to be enforced, then suitable documentation should be provided for new users. It seems that security is now a step ahead of usability?

Steps to Reproduce:
1.Set email cliednt (tools/options) to claws-mail or xdg-email
2.send (current) document as attachment
3.

Actual Results:
Neither LO nor email client has focus, and nothing happens

Expected Results:
Document should be properly attached to n (draft) email

Reproducible: Always

User Profile Reset: Yes

OpenGL enabled: Yes

Additional Info:
Always worked fine until 6.0

User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) QupZilla/1.8.9 Safari/538.1

Revision history for this message
David van der Wal (statitica) wrote :

Confirm fixed under latest libreOffice update, and Ubuntu MATE 16.04
Thanks

Revision history for this message
In , Olivier Tilloy (osomon) wrote :

Tested and I can reproduce the issue when claws-mail is the default e-mail client on the system, even with apparmor profiles disabled (so unlikely to be an apparmor-related issue).

Revision history for this message
In , Dgp-mail (dgp-mail) wrote :

(In reply to Olivier Tilloy from comment #1)
> Tested and I can reproduce the issue

Olivier, if you can reproduce the issue, you can change status to NEW (I did it,because of your comment)

Revision history for this message
In , Bernard Moreton (bernard-moreton-1) wrote :

Send by email still fails in 6.1.1.2.
This is disappointing, since 'sending' a document is a basic operation, which users would naturally expect. As noted, this all worked prior to 6.0, so it's a regression.

Revision history for this message
In , Bernard Moreton (bernard-moreton-1) wrote :

I see a similar report on Apache OpenOffice, also on the Ubuntu bug reports.
Following a hint from the latter, I deleted the entry "/usr/bin/claws-mail" in Tools/Options/Internet/Email and tried again to send a document. This time no error was reported to the GUI, but I'd called soffice from the commandline, and there an error had appeared "/usr/lib/libreoffice/program/senddoc: 361: /usr/lib/libreoffice/program/senddoc: /usr/bin/claws-mail: Permission denied"

A long listing shows
-rwxr-xr-x 1 root root 3950472 Dec 17 2017 /usr/bin/claws-mail
which looks ok?

I'll restore the setting in Tools/Options, since a visible error message is better than an invisible one!

Revision history for this message
In , Bernard Moreton (bernard-moreton-1) wrote :

I modified 'senddoc' temporarily, to 'echo' the claws-mail command, and opened my testfile again from the commandline. That showed
/usr/bin/claws-mail --attach /tmp/lu35337hoq3k.tmp/lu35337hoq3n.tmp/errors_090715.odt
(all on one line).

A further edit to 'ls' the attachment file gave
/usr/lib/libreoffice/program/senddoc: 363: /usr/lib/libreoffice/program/senddoc: ls: Permission denied

Running the claws-mail command from the commandline (while LO was still open) gave a similar result: file does not exist, or no permission.

Doing 'ls -l' from the command line shows the file still existing, with directory permissions restricted to me as the owner.

A permissions problem, then? But I can't see what it is.

Revision history for this message
Bernard Moreton (bernard-moreton-1) wrote :

The problem still affects me:
Ubuntu 18.04.1
LO 6.1.1.2
claws-mail
senddoc will not call claws-mail, or 'ls', or 'sleep'

See LibreOffice Bugzilla: Bug 116211 - LO Send by email fails in Writer

Revision history for this message
In , Bernard Moreton (bernard-moreton-1) wrote :

See also Ubuntu Bug #1748895
LO unable to find a working email configuration

Revision history for this message
In , Bernard Moreton (bernard-moreton-1) wrote :

With respect, I think the problem is related to apparmor.
When Tools/Options/Internet/Email is set to /usr/bin/claws-mail, the error window appears (working email client not found), an error message is sent to screen (Writer called from the command line),
"/usr/lib/libreoffice/program/senddoc: 366: /usr/lib/libreoffice/program/senddoc: /usr/bin/claws-mail: Permission denied", and the kernel log contains 3 DENIED lines,
Sep 20 10:09:04 USER_ID-Inspiron-5767 kernel: [ 1965.191418] audit: type=1400 audit(1537434544.991:41): apparmor="DENIED" operation="file_inherit" profile="libreoffice-senddoc" name="/home/USR/errors_090715.odt" pid=4934 comm="senddoc" requested_mask="wr" denied_mask="wr" fsuid=1001 ouid=1001
Sep 20 10:09:04 USER_ID-Inspiron-5767 kernel: [ 1965.191423] audit: type=1400 audit(1537434544.991:42): apparmor="DENIED" operation="file_inherit" profile="libreoffice-senddoc" name="/home/USR/.config/libreoffice/4/user/uno_packages/cache/uno_packages.pmap" pid=4934 comm="senddoc" requested_mask="wr" denied_mask="wr" fsuid=1001 ouid=1001
Sep 20 10:09:05 USER_ID-Inspiron-5767 kernel: [ 1965.196286] audit: type=1400 audit(1537434544.995:43): apparmor="DENIED" operation="exec" profile="libreoffice-senddoc" name="/usr/bin/claws-mail" pid=4940 comm="senddoc" requested_mask="x" denied_mask="x" fsuid=1001 ouid=0

If Tools ... Email is set to xdg-email (timed at 10:12) or set to be blank (timed at 10:16), then no error window appears, the screen error message does not appear, and two DENIED lines appear in the kernel log:

Sep 20 10:12:24 USER_ID-Inspiron-5767 kernel: [ 2164.882567] audit: type=1400 audit(1537434744.681:53): apparmor="DENIED" operation="file_inherit" profile="libreoffice-senddoc" name="/home/USR/errors_090715.odt" pid=5014 comm="senddoc" requested_mask="wr" denied_mask="wr" fsuid=1001 ouid=1001
Sep 20 10:12:24 USER_ID-Inspiron-5767 kernel: [ 2164.882572] audit: type=1400 audit(1537434744.681:54): apparmor="DENIED" operation="file_inherit" profile="libreoffice-senddoc" name="/home/USR/.config/libreoffice/4/user/uno_packages/cache/uno_packages.pmap" pid=5014 comm="senddoc" requested_mask="wr" denied_mask="wr" fsuid=1001 ouid=1001

Sep 20 10:16:27 USER_ID-Inspiron-5767 kernel: [ 2408.161860] audit: type=1400 audit(1537434987.959:65): apparmor="DENIED" operation="file_inherit" profile="libreoffice-senddoc" name="/home/USR/errors_090715.odt" pid=5171 comm="senddoc" requested_mask="wr" denied_mask="wr" fsuid=1001 ouid=1001
Sep 20 10:16:27 USER_ID-Inspiron-5767 kernel: [ 2408.161865] audit: type=1400 audit(1537434987.959:66): apparmor="DENIED" operation="file_inherit" profile="libreoffice-senddoc" name="/home/USR/.config/libreoffice/4/user/uno_packages/cache/uno_packages.pmap" pid=5171 comm="senddoc" requested_mask="wr" denied_mask="wr" fsuid=1001 ouid=1001

Revision history for this message
In , Bernard Moreton (bernard-moreton-1) wrote :

I should have added that when Tools ... Email is set to xdg-email (timed at 10:12) or set to be blank (timed at 10:16), then claws-mail is called, but without focus, and without any COMPOSE window. Focus has to be manually restored to CLAWS by clicking on it, before anything else can be done ...

Revision history for this message
In , Bernard Moreton (bernard-moreton-1) wrote :

Sorry to post so much, but I think I've found the problem, and a solution.

1 For convenience, I've set Tools/Options/Internet/Email to use /usr/bin/xdg-email

2 The supplied senddoc then outputs the command (all on one line):
/usr/bin/xdg-email mailto:?subject=errors_090715&attach=file:///tmp/lu3461d8a63c.tmp/lu3461d8a63f.tmp/errors_090715.odt &
This brings my claws-mail window to the fore, but without focus, and fails to open a compose window.
If I run the same command by copy-n-paste from the command line, then a compose window opens, but there is no attachment.

3 If I change the xdg entry in senddoc
--attach)
                    MAILTO="${MAILTO:-}${MAILTO:+&}attach="$(echo "$2" | "${URI_ENCODE}")
                    #MAILTO="${MAILTO:-}${MAILTO:+&}attach="$(echo "file://$2" | "${URI_ENCODE}")
                    shift
                    ;;
and take out the ampersand in the mail call (may not be significant, but calls for other mail clients don't use the ampersand, and senddoc will then wait for completion)
        ${MAILER} "${MAILTO}"
        # ${MAILER} "${MAILTO}" &
then senddoc completes properly, opening a compose window, with the required attachment.

4 Apparmor still registers two DENIED lines to kernel.log, one about the original file opened in Writer, and one about the .config file (see my Comment 7 above). These don't have any effect on the functioning of Senddoc, but they shouldn't appear.

5 The solution outlined above is not complete
(1) it may have bad effect on Evolution and/or Gnome, which are linked with Xdg in the 'case' statement
(2) the provision to cover a blank entry in Tools/Options/Internet/Email needs to be changed in line with the change in the entru for Xdg
(3) though the output command
/usr/bin/xdg-email mailto:?subject=errors_090715&attach=/tmp/lu3461d8a63c.tmp/lu3461d8a63h.tmp/errors_090715.odt
works ok, it is not in accord with the format given in the man page for xdg-email ( --subject TITLE --attach FILE), which I find a little disturbing.

Revision history for this message
Olivier Tilloy (osomon) wrote :

Re-opening per user comment and upstream report.

Changed in libreoffice (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
In , Bernard Moreton (bernard-moreton-1) wrote :

Created attachment 145467
A proposed revision for /usr/lib/libreoffice/program/senddoc

A proposed revision for /usr/lib/libreoffice/program/senddoc

Revision history for this message
In , Bernard Moreton (bernard-moreton-1) wrote :

The uploaded revision of SENDDOC works ok on my system (LO 6.1.2.1, Ubuntu 18.04.1) when Tools, Options, Internet, Email E-mail program is left blank, or filled as /usr/bin/xdg-email.

The URI syntax "file://" for attachments does not work with (most?) system email clients; and I have left comments at lines 109, 380, and 443, where I doubt whether this syntax is appropriate for thunderbird, Mail or Thunderbird, or for DESKTOP_LAUNCHER.
All instances need review however.

I've tested a call using /usr/bin/xdg-open in my configuration setting. This has the same problem as I had with xdg-email, ie Sending a file by email opened my email client, but without focus, and no compose window appeared.
I conclude that the URI syntax is unreliable, and that a simple filename reference should therefore be preferred.
I have not implemented that in my uploaded revision of SENDDOC!

On a LINUX system, the clients provided for in SENDDOC should all be ok (I think) when AppArmor is not in use.

Where AppArmor is in use, and there is a policy set for SENDDOC, then I suggest that
(a) the Options-Internet-Email program should not allow input, but perhaps should show the system default email client; and
(b) to avoid problems, the call to SENDDOC should not pass any client identification.

Revision history for this message
In , Xiscofauli (xiscofauli) wrote :

Hi Bernard,
Thanks for the patch!
Would you mind submitting it to gerrit instead? you can have more informacion here https://wiki.documentfoundation.org/Development/gerrit/SubmitPatch

Revision history for this message
In , Bernard Moreton (bernard-moreton-1) wrote :

Hi Xisco,

I'm afraid I'm not familiar with GIT - perhaps I should be, but 24x7 care leaves me little opportunity for doing new things. Would you mind submitting the revision for me? License? - as for the existing SENDDOC, of course - or whatever is most free.

MTIA, Bernard

Changed in df-libreoffice:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , Ankur Joshi (pharmankur) wrote :

Since upgraded to LO 6.1.0 onwards started facing the problem of documents send by email stopped working

Also post here mentions about a macro which sends email with PDF attachment using a email client as THUNDERBIRD, the basic issue is setting [ Libreoffice --> TOOLS --> OPTIONS --> INTERNET --> E-MAIL --> EMAIL PROGRAM --> browse & set to --> /usr/bin/thunderbird ] is not firing up THUNDERBIRD

BUT Geary works with same LO 6.1.2 [ Libreoffice --> TOOLS --> OPTIONS --> INTERNET --> E-MAIL --> EMAIL PROGRAM --> browse & set to --> /usr/bin/geary ]

Using Linux Mint 19
---------------------------------------------------------------------------

Find my detailed posting about mentioned 'MACRO' at

https://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=89073&p=457389#p426971

>>>

After upgrading to Linux Mint 19 + Thunderbird 60 + Libreoffice 6.1.2 ; Emailing through the macro suddenly started behaving strangely. The email body text generated through macro started appearing in Recipient email boxes in thunderbird and is not usable.
Setting up Thunderbird as email client [ Libreoffice --> TOOLS --> OPTIONS --> INTERNET --> E-MAIL --> EMAIL PROGRAM --> browse & set to --> /usr/bin/thunderbird ] in libreoffice is also not working; as it is no more firing up thunderbird.

I do not know what is going wrong , Also I dont know whether bug is in Libreoffice Or Thunderbird Or somewhere else.

But here is the finely working workaround ---
Solution is to use geary email client, Set GEARY as default email client in linux mint. Also set geary in libreoffice [ Libreoffice --> TOOLS --> OPTIONS --> INTERNET --> E-MAIL --> EMAIL PROGRAM --> browse & set to --> /usr/bin/geary ]

......... UPDATE ...........

Tested with Libreoffice 6.0.7.3 in Linux Mint 19 & with Thunderbird 60.2.1 (64-bit) --- And it worked charmingly as before !!!

So definitely Libreoffice 6.1.2 has the bug, strangely specific to THUNDERBIRD only ... as GEARY works in both version of libreoffice.

<<<<<<

Revision history for this message
In , Bernard Moreton (bernard-moreton-1) wrote :

GEARY works simply because it is not named in program senddoc, which then uses xdg-email as a default, to call the system email client, whatever it is. But hey, as an entry in Tools/.../Internet, it works!

So, possibly, would "/usr/bin/wxyz" ...

Revision history for this message
In , Ankur Joshi (pharmankur) wrote :

(In reply to Bernard Moreton from comment #15)
> GEARY works simply because it is not named in program senddoc, which then
> uses xdg-email as a default, to call the system email client, whatever it
> is. But hey, as an entry in Tools/.../Internet, it works!
>
> So, possibly, would "/usr/bin/wxyz" ...

:)
Did not get you Bernard !

So there is a bug or not ??? Because since LO 6.0.7 Thunderbird was working for me with exactly same configuration.

Now Geary is working but not the thunderbird. For whatever reason same configs are working for Geary and not for Thunderbird Or Kmail Or Claws Mail , isn't it a bit odd ?

I am habituated to use Thunderbird, Geary even though works; I feel compromised while using it. Thus earlier this bug is resolved ... it will be better !!

Meanwhile I have fallen back to LO 6.0.7 & enjoying using Thunderbird.

Revision history for this message
Olivier Tilloy (osomon) wrote :

The original issue reported here was fixed.

The other issue people are seeing is bug #1803604, so let's continue the conversation there.

Changed in libreoffice (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
In , Bernard Moreton (bernard-moreton-1) wrote :

6.3.0.4 includes most of the changes I suggested, but still fails to operate properly - it switches the focus to the email client, but fails to create a new email.

I thnk the problem may be at senddoc line 293,
MAILTO="${MAILTO:-}${MAILTO:+&}attach="$(echo "file://$2" | "${URI_ENCODE}")

My email client (Claws-mail) fails to handle the "file://" syntax, as do some other email clients.

My suggestion (lines 269-276 of my proposed revision) was to omit the file:// (at least for xdg-email), so that the command then is
MAILTO="${MAILTO:-}${MAILTO:+&}attach="$(echo "$2" | "${URI_ENCODE}")

That then works; though I found it advisable to omit the ampersand in the mail command (can't immediately remember why, sorry!), so that that command became simply
${MAILER} "${MAILTO}"

Version: 6.3.0.4
Build ID: 1:6.3.0-0ubuntu0.18.04.1~lo2
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3;
Locale: en-GB (en_GB.UTF-8); UI-Language: en-GB
Calc: threaded

Revision history for this message
In , Bernard Moreton (bernard-moreton-1) wrote :

There is a new twist to this saga.
With LO 7.0.1.2 today I get an error message
/home/mbm/.claws-mail/mimetmp/.comments: unlink: Is a directory

** (claws-mail:12915): WARNING **: 10:04:23.190: failed to convert encoding of file name: Invalid byte sequence in conversion input
malloc_consolidate(): invalid chunk size

This happens whether I set email (Tools,Option) as blank, or as xdg-email
In either case, using my proposed patched form of sesnddoc, I get a Claws-mail error window within a Compose window. On acknowledging the message, Claws crashes.

If I use the version of senddoc that comes with LO 7.0.1.2, I get no Compose window, and Claws-mail simply crashes.

This was working ok a fortnight ago, with LO 7.0.1.2
Claws-mail has not changed in Ubuntu 20.04 since then.
I wonder whether uri-encode is no longer working properly?

And if I export my LO document to a file, then I can Compose, and attach that file, and send, all ok

Revision history for this message
In , oblong (bob-oblong) wrote :

Hopefully not confusing things by adding this information... I use LibreOffice "E-mail as PDF" a lot. After about a fortnight of not having used it, when it worked fine, today I tried again.

Linux Mint 19.3 MATE; Thunderbird 68.10.0; LibreOffice 6.0.7.3.
LO Tools|Options|Internet|E-mail program field is blank (and has always been like that).

The Thunderbird compose window opened, but there was no attachment. No improvement after closing/restarting LO, Thunderbird or restarting Mint.

kern.log has:

Nov 27 14:51:03 bob-mint kernel: [ 1934.824706] audit: type=1400 audit(1606452663.111:205): apparmor="DENIED" operation="file_inherit" profile="libreoffice-senddoc" name=2F686F6D652F626F622F446F63756D656E74732F576F72642F424F422F4F626C6F6E672F54617820496E766F696365732F323032302F323032303131323730322D626967672D64616E2E6F6474 pid=7510 comm="senddoc" requested_mask="wr" denied_mask="wr" fsuid=1000 ouid=1000

Nov 27 14:51:03 bob-mint kernel: [ 1934.824714] audit: type=1400 audit(1606452663.111:206): apparmor="DENIED" operation="file_inherit" profile="libreoffice-senddoc" name="/home/bob/.config/libreoffice/4/user/uno_packages/cache/uno_packages.pmap" pid=7510 comm="senddoc" requested_mask="wr" denied_mask="wr" fsuid=1000 ouid=1000

Nov 27 14:51:03 bob-mint kernel: [ 1934.824719] audit: type=1400 audit(1606452663.111:207): apparmor="DENIED" operation="file_inherit" profile="libreoffice-senddoc" name="/usr/share/libreoffice/help/en-US/shared.jar" pid=7510 comm="senddoc" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

LO has no problem exporting the PDF and Thunderbird can manually attach it.

Caja 1.22.2 right-click Send to...E-mail works as expected.

If I run "libreoffice --writer" from the terminal there are no error messages there when doing the E-mail as PDF, but again no attachment appears.

The only thing I was brave enough to change, as the log mentioned it, was to change the permission of:
/home/bob/.config/libreoffice/4/user/uno_packages/cache/uno_packages.pmap
to 777. Made no difference.

Not sure what it all means!

Revision history for this message
In , Bernard Moreton (bernard-moreton-1) wrote :

Just to clarify my remarks yesterday,
the error window in Claws-mail showed a filename that looked very much as though it had been encoded.

There may be some upgrade to the system that caused the change in behaviour -
simplescan has taken to ignoring the ADG and scanning from the glass,
Acroread has also taken to printing only the first page of any page selection.
It's difficult not to suspect some common cause.

But in senddoc
attachment="$(echo "file://$2" | "${URI_ENCODE}")
may be suspect anyway?

Revision history for this message
In , Bernard Moreton (bernard-moreton-1) wrote :

And further to my last comment, the point is proved.
Claws[-mail] is set in senddoc to use
ATTACH="${ATTACH:-}${ATTACH:+ }$2"
without any reference to encoding.

In Tools.Options, I set email to /usr/bin/claws-mail
and all is well, the document is attached to a draft email in a Compose window.

The use of URI_ENCODE in conjunction with the attachment filename seems to be wrong - though why it caused no problems until recently I do not understand!

Revision history for this message
In , oblong (bob-oblong) wrote :

I noticed a couple of days ago (17th or 18th Jan 2021) that Send e-mail as PDF started to work again. Presumably some update fixed things. So that's great!

(Linux Mint MATE 19.3, Thunderbird 68.10.0, LibreOffice Version: 6.0.7.3 - all those versions unchanged.)

Revision history for this message
In , Bernard Moreton (bernard-moreton-1) wrote :

In the current version of LO, 7.1.2.2 (Ubuntu build, on Ubuntu 20.04 LTS),
there has been no change to senddoc since the last installed version (7.0.1.2),
but the behaviour is significantly different.

1
Using the supplied senddoc (7.1.2.2), and trying to send a PDF attachment,

(a)
if Tools/Options/Internet/Email is set as <blank>,
Claws-mail freezes, so that no ALT-TAB is possible, and has to be shut down,
and I gete a message on Terminal:
 /home/mbm/.claws-mail/mimetmp/.comments: unlink: Is a directory
** (claws-mail:7281): WARNING **: 11:27:50.598: failed to convert encoding of file name: Invalid byte sequence in conversion input

(b)
If Tools/Options/... is set to /usr/bin/claws-mail
I get an LO error window 'unable to find a working email configuration
and an error on Terminal
"/usr/lib/libreoffice/program/senddoc: 387: /usr/bin/claws-mail: Permission denied" (perhaps from AppArmor ???)

(c)
If Tools/Options/... is set to /usr/bin/xdg-email
then focus switches to the Claws-mail client, but no Compose window appears, and no error message is given, but the Claws-mail window is frozen, without focus, and needs to be clicked intofocus before anything more can be done.

2
Using the fix script I suggested some while ago, and trying to send a PDF attachment,
if Tools/Options/Internet/Email is set to /usr/bin/claws-mail (my standard client), I get a LO error "unable to find a working email configuration".
If I set the option to either /usr/bin/xdg-email or to <blank>,
I get an error on my Claws-mail client, File <encoded garbge> doesn't exist or permission denied", and the email clinet is closed altogether when I close the er3ror message window.
and sometimes (not always) I get an error on my Terminal,
** (claws-mail:7281): WARNING **: 11:27:50.598: failed to convert encoding of file name: Invalid byte sequence in conversion input

3
I note that in senddoc, against the "sylpheed | claws" entry, there is
ATTACH="${ATTACH:-}${ATTACH:+ }$2"
and against xdg-email there is
MAILTO="${MAILTO:-}${MAILTO:+&}attachment="$(echo "file://$2" | "${URI_ENCODE}")

The use of URI_ENCODE here is probably not right, the UTI file usage (file://$2) certainly doesn't work when passed to Claws-mail, and xdg-email doesn't seem to recognize it either.

Revision history for this message
In , Bernard Moreton (bernard-moreton-1) wrote :

I believe there is a bug in xdg-email affecting --attach
(https://bugs.launchpad.net/ubuntu/+source/xdg-utils/+bug/1909941?comments=all)

Revision history for this message
In , Bernard Moreton (bernard-moreton-1) wrote :

I believe there is a bug in xdg-email affecting --attach
(https://bugs.launchpad.net/ubuntu/+source/xdg-utils/+bug/1909941?comments=all)
(sorry, the last attempt closed on me before I'd finished)

The fix for that wor3ks in Claws-mail 3.17.8, but not in 3.17.5 which is the latest version for Ubuntu 20.04 LTS.

I get the same error when calling xdg-email --attach FILENAME from the command-line as seems to be occurring when it is run from senddoc.

I've asked for a backport of Claws 3.17.8 to Ubuntu 20.04 ... !

Revision history for this message
In , Bernard Moreton (bernard-moreton-1) wrote :

Until communication between xdg-email and claws-mail is fixed in Ubuntu LTS, I've resolved the problem by (a) adding a claws-mail line in the apparmor profile for senddoc and reloading the policy. and (b) setting Tools/Options/Internet/Email to specify /usr/bin/claws-mail.
I don't like messing with system files like that, but it now works again properly.

Revision history for this message
In , Timur-y (timur-y) wrote :

Reading this, I don't see it as LO bug. And it well may be NotOurBug.
I restrict to claws-mail and kindly ask reporter to follow up with new version.
Since Ubuntu bug is listed, this can simply be closed.

Revision history for this message
In , Z-bernard-moreton (z-bernard-moreton) wrote :

There are 3 levels at which this is an LO bug:

(1) senddoc provides settings for claws-mail (claws|sylpheed), which work fine, EXCEPT that since apparmor was enforced, these settings only work if claws-mail is included in the apparmor settings

(2) xdg-email is seen as the default email application, but the coding in senddoc uses the 'mailto:' command format. The manual for xdg-email is explicit "xdg-email limits support to, cc, subject and body fields in mailto-uri, all other fields are silently ignored."

This makes xdg-email with mailto: command format a bad choice for LO's senddoc. If the alternative command-line-style were used, with simple email addresses rather than the mailto: style, I think all would be well. It certainly works well for me from the command line.

(3) the screen prompts for the setting of Tools-Options-Internet-Email are not helpful. Perhaps they couldn't be until senddoc works dependably for all reasonable email clients.

Evolution, kmail, icedove, and thunderbird are given specific entries in senddoc; I don;t know how well they work - but all other clients must be a potential problem.

The implication in this user configuration setting is that any email application should work. That simply is not so.

I agree with Timur (#27) that a main problem in in xdg-email, but I can find no indication that its maintainers are likely to extend the capabilities of the mailto: option. In the meantime, however, LO could and should use the command option that does the essential job of attaching the document to the email. And then improve the Tools-Options email entry screen.

Revision history for this message
In , Timur-y (timur-y) wrote :

I tested sending with claws-email now, previously I used mutt, and all is working, composer window is invoked and file is attached.
I understood this bug was about claws-email but if not it needs a precision.

"xdg-email is a command line tool for sending mail using the user's preferred e-mail composer" so why would it be used in Tools/Options/Internet/Email I don't know.
My understanding is that it's working implicitly, if you don't set Email than xdg-email is used to invoke some (from Default/Preferred Applications).
In my case, when I deleted claws-email path from Email and not from the system, it used mutt.
But I got no screen prompts for the setting of Tools-Options-Internet-Email? Please paste screenshot here.

Mail from mutt was composed and sent but without attachment.
I then changed system mail to claws-email and xdg-email invoked claws-email but without composer window.
So for me, bug is that xdg-email doesn't attach file or compose mail, seen when when having Email empty ie. relying on xdg-email. Mine is version 1.1.2 from Ubuntu 18.04.
But it should be that Ubuntu bug. And there "xdg-utils 1.1.3-4.1ubuntu1.22.04.1 seems to have fixed this".

(1) seems Ubuntu bug. (2) I wrote my view on xdg-utils (3) I asked you to clarify, to have all here, but that would be another issue anyway.

Revision history for this message
In , Timur-y (timur-y) wrote :

Oh, not really well in Ubuntu 22.04.
Lo has sensible-lomua set in Email (don't know what's that, probably ends with xdg-email anyway) but behaves like when empty, invoking default mail which I set to be claws-mail. Also program window invoked, not composer window. xdg-email is 1.1.3-4.1. So that would be the same, not resolved.
Another new problem: if I set Email to /usr/bin/claws-mail, I get a message "LO unable to find a working mail configuration". claws-mail is version 4.0

If system has no default email client, sending with LO doesn't give any warning. That would be another issue, related to (3).

Revision history for this message
In , Timur-y (timur-y) wrote :

This would be a duplicate of bug 74067 with similar problem in bug 75825.
Or we may regard this one for sending attachment and other one for warning.
That one lists commit 8e7a3669dd86f86325b3012abc657b5d4665374d titled Combine senddoc null and default cases for better mailer selection.

Changed in df-libreoffice:
status: Confirmed → Incomplete
Revision history for this message
In , Z-bernard-moreton (z-bernard-moreton) wrote :

I get over the problem by inserting a line for claws-mail in apparmor profile for senddoc, and specifying claws-mail (with full path) in Options-Tools-...Email.

A better option would be to rewrite the xdg-email code in senddoc along the lines of the block for claws|sylpheed (though in LO, the 'To' field is presumably not required ...). This would make the default generally useful for all email clients, where currently it simply doesn't attach, which is the whole point of senddoc ...

I'll continue to hope that Ubuntu 22.04 xdg-utils will fix the attachment problem, since it affects scanning to email as well as LO; but there'' be many LO users who remain on current (non-functioning) xdg-email maitto: style. They should be helped, even if the rest of us do find salvation ...

Revision history for this message
In , Qa-admin-q (qa-admin-q) wrote :

[Automated Action] NeedInfo-To-Unconfirmed

Changed in df-libreoffice:
status: Incomplete → New
Revision history for this message
cement_head (andorjkiss) wrote :

I can spawn a composer window (Thunderbird) from LO, but no document gets attached. Using the Flatpak install of LO. Any suggestions?

Revision history for this message
In , Z-bernard-moreton (z-bernard-moreton) wrote :

Created attachment 181206
revision of (current) senddoc to correct problems

Revisions labelled #001 enable sending email when Tools-Options-Internet-Email is set to /usr/bin/xdg-email (under Ubuntu 20.04 LTS)

The revision labelled #002 enable sending document as email when Option-Email is blank - in this case LO currently does NOT supply any MAILER to senddoc.

Revision history for this message
In , Z-bernard-moreton (z-bernard-moreton) wrote :

Against Timurs comment #29, "(3) I asked you to clarify, to have all here, but that would be another issue anyway.",

- the Browse button doesn't really help the user (it listes all files in the HOME directory
- and though the user might want to enter a simple application name (and perhaps should be given a list of found names to choose from), past experience suggested that a full path may be desirable.
- the button might be better to validate an entered application name?

The user can't be assumed to know the file system!

Revision history for this message
In , R-cabane (r-cabane) wrote :

I'm having the same bug since upgrading to LO 7.4 (perhaps also 7.3.4, I don't remember).
Context :
OpenSuSE Linux
TDF LO 7.4.1
mailer = thunderbird (declared as such in the Options)
What happens : when I try to send a doc my mail (clicking on the dedicated button), Thunderbird's composer windows appears but nothing is attached.

Revision history for this message
In , Stephane-guillou-i (stephane-guillou-i) wrote :

*** Bug 154479 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Stephane-guillou-i (stephane-guillou-i) wrote :

Clearly issues to solve, including in link to Thunderbird as in duplicate but 154479.
Thanks Bernard for continuously looking into it, and please don't hesitate submitting a patch on gerrit if you think it can improve the situation.

Changed in df-libreoffice:
status: New → Confirmed
Revision history for this message
In , Timur-y (timur-y) wrote :

*** Bug 138158 has been marked as a duplicate of this bug. ***

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.