LO can't send email, probably an apparmour problem

Bug #1899667 reported by SA
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
kmail (Ubuntu)
Confirmed
Low
Unassigned
libreoffice (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

LO can't send email:

LibreOffice was unable to find a working email configuration.

I'm pretty sure this is an apparmour profile problem since LO seems to want RW perms on something and AA seems not to want to give it. There lies the full extent on mu debugging expertise in this area.

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: ubuntu-release-upgrader-core 1:20.04.25
ProcVersionSignature: Ubuntu 5.4.0-48.52-generic 5.4.60
Uname: Linux 5.4.0-48-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu27.9
Architecture: amd64
CasperMD5CheckResult: skip
CrashDB: ubuntu
CurrentDesktop: KDE
Date: Tue Oct 13 17:01:43 2020
InstallationDate: Installed on 2017-03-26 (1297 days ago)
InstallationMedia: Kubuntu 16.10 "Yakkety Yak" - Release amd64 (20161012.1)
PackageArchitecture: all
SourcePackage: ubuntu-release-upgrader
Symptom: release-upgrade
UpgradeStatus: Upgraded to focal on 2020-10-08 (4 days ago)
VarLogDistupgradeXorgFixuplog:
 INFO:root:/usr/bin/do-release-upgrade running
 INFO:root:No xorg.conf, exiting

Revision history for this message
SA (superaorta) wrote :
Revision history for this message
SA (superaorta) wrote :

[] audit: type=1400 audit(): apparmor="DENIED" operation="file_inherit" profile="libreoffice-senddoc" name="xxxxx" pid=8106 comm="senddoc" requested_mask="wr" denied_mask="wr" fsuid=1000 ouid=1000

[] audit: type=1400 audit(): apparmor="DENIED" operation="exec" profile="libreoffice-senddoc" name="/usr/bin/kmail" pid=8116 comm="senddoc" requested_mask="x" denied_mask="x" fsuid=1000 ouid=0

cat /etc/apparmor.d/usr.lib.libreoffice.program.senddoc

#include <tunables/global>

profile libreoffice-senddoc /usr/lib/libreoffice/program/senddoc {
  #include <abstractions/base>

  #include <abstractions/user-tmp>

  /{usr/,}bin/sh rmix,
  /{usr/,}bin/bash rmix,
  /{usr/,}bin/dash rmix,
  /{usr/,}bin/sed rmix,
  /usr/bin/dirname rmix,
  /usr/bin/basename rmix,
  /{usr/,}bin/grep rmix,
  /{usr/,}bin/uname rmix,
  /usr/bin/xdg-open rPUx,
  /usr/bin/xdg-email rPUx,
  /dev/null rw,
  /usr/lib/libreoffice/program/uri-encode rmpux,
  /usr/share/libreoffice/share/config/* r,
  owner @{HOME}/.config/libreoffice{,dev}/?/user/uno_packages/cache/log.txt rw,
}

no longer affects: ubuntu-release-upgrader (Ubuntu)
Revision history for this message
SA (superaorta) wrote :

disabling usr.lib.libreoffice.program.senddoc doesn't fix it but does change the nature of the compliant from RW to X

disabling usr.lib.libreoffice.program.soffice.bin, in addition, solves the kmail problem and permits running of kmail

=> apparmour profile problem

Changed in libreoffice (Ubuntu):
importance: Undecided → Low
Changed in kmail (Ubuntu):
importance: Undecided → Low
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in kmail (Ubuntu):
status: New → Confirmed
Changed in libreoffice (Ubuntu):
status: New → Confirmed
Revision history for this message
Robert Hrovat (robi-hipnos) wrote :

The same happens on Ubuntu Gnome versions. It looks like apparmour problem.
I did next steps to make it work:

ln -s /etc/apparmor.d/usr.lib.libreoffice.program.oosplash /etc/apparmor.d/disable/
apparmor_parser -R /etc/apparmor.d/usr.lib.libreoffice.program.oosplash

ln -s /etc/apparmor.d/usr.lib.libreoffice.program.soffice.bin /etc/apparmor.d/disable/
apparmor_parser -R /etc/apparmor.d/usr.lib.libreoffice.program.soffice.bin

ln -s /etc/apparmor.d/usr.lib.libreoffice.program.senddoc /etc/apparmor.d/disable/
apparmor_parser -R /etc/apparmor.d/usr.lib.libreoffice.program.senddoc

And after that I had to replace sensible-lomua with thunderbird inside LO Tools -> Settings -> Internet -> E-mail client.

I don't know why sensbile-lomua does not exist anymore and nothing else works. Even if I put xdg-email or just thunderbird. Without apparmor changes it does nothing.

Revision history for this message
Sylvain L. (sly73) wrote :

I can confirm Robert's message : on Ubuntu 20.04 default gnome install, it doesn't attach a file.
And the proposed apparmor "fix" + set to thunderbird did the trick.

Alsos note that if using "Ubuntu live" from an USB key, with a correctly setup thunderbird, the composer windows of thunderbird does include the file when used from libreoffice's "send file/pdf per email"

Revision history for this message
LanceHaverkamp (lance-thehaverkamps) wrote :

This is still broken in Kubuntu, as of 22.10. I use LO & Thunderbird. The preliminary steps happen, such as creating a PDF--if requested. But the email application (Thunderbird in my case) is never called.

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.