LO unable to find a working email configuration

Bug #1748895 reported by cement_head on 2018-02-12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
libreoffice (Ubuntu)
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
  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


  Should spawn an new Evolution eMAIL with attached ODF document


  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

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
Olivier Tilloy (osomon) wrote :

And the following error is most likely related:

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

Olivier Tilloy (osomon) wrote :

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

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"

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.

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) on 2018-02-12
Changed in libreoffice (Ubuntu):
assignee: nobody → Olivier Tilloy (osomon)
importance: Undecided → Medium
Olivier Tilloy (osomon) wrote :
Changed in libreoffice (Ubuntu):
status: Confirmed → In Progress
Olivier Tilloy (osomon) wrote :
Changed in libreoffice (Ubuntu):
status: In Progress → Fix Committed
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
cement_head (andorjkiss) wrote :

Still in LO 6.0.x

David van der Wal (statitica) wrote :

Still present with LO6 and Thunderbird on Ubuntu 16.04.03

Olivier Tilloy (osomon) wrote :

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

    apt policy libreoffice-common

David van der Wal (statitica) wrote :

apt policy 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

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).

cement_head (andorjkiss) wrote :

Nope. Still broken.

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

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

cement_head (andorjkiss) wrote :

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

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

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

David van der Wal (statitica) wrote :

Confirm fixed under latest libreOffice update, and Ubuntu MATE 16.04

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).

(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)

Send by email still fails in
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.

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!

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.

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

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

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

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

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 ...

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
                    MAILTO="${MAILTO:-}${MAILTO:+&}attach="$(echo "$2" | "${URI_ENCODE}")
                    #MAILTO="${MAILTO:-}${MAILTO:+&}attach="$(echo "file://$2" | "${URI_ENCODE}")
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.

Olivier Tilloy (osomon) wrote :

Re-opening per user comment and upstream report.

Changed in libreoffice (Ubuntu):
status: Fix Released → Confirmed

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

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

The uploaded revision of SENDDOC works ok on my system (LO, 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.

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

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

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



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 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.


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" ...

(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.

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 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

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

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.