tag 1095729 + unreproducible
tag 1095729 + moreinfo
thanks

Hi,

sorry for the late answer.

Since I did some other apparmor stuff lately for LO I just remembered this 
(still some time to get a fix in if needed) had a look and I think it's just a 
misconfiguration/configuration changes in LO without being aware of the 
consequences.

We don't allow random stuff in senddoc. That is intended.

Basically LO can't send emails because apparmor blocks it. This is a total PITA.

What exactly is blocked? apparmor log, please? I am guessing you try to access 
kmail directly?

It might be that libreoffice-plasma or libreoffice-kf5 should "fix" it but I 
don't know.

Shouldn't.

I'm sure this has been reported many times before but the random medley of old 
bug reports relating to similar problems in very confusing.

Actuallly not.

So for this actual issue:

1. default config as mailer is "sensible-lomua". "sensible-lomua" is not an 
actual command but handled in senddoc (cf. )

+case `basename "$MAILER"` in
+    sensible-lomua)
+        if [ -x /usr/bin/xdg-email ] ; then
+            MAILER=/usr/bin/xdg-email
+        elif [ -n "$KDE_FULL_SESSION" -a -x /usr/bin/kde-open ] \
+           || [ -x /usr/bin/gnome-open ] \
+           || [ -x /usr/bin/xdg-open ]; then
+            # use an undefined mailer, to trigger the default handling
+            MAILER=undefined
+        elif [ -n "$GNOME_DESKTOP_SESSION_ID" -a -x /usr/bin/evolution ]; then
+            MAILER=/usr/bin/evolution
+        elif [ -n "$KDE_FULL_SESSION" -a -x /usr/bin/kmail ]; then
+            MAILER=/usr/bin/kmail
+        elif [ -x /usr/bin/evolution ]; then
+            # default
+            MAILER=/usr/bin/evolution
+        elif [ -x /usr/bin/icedove ]; then
+            # fallback
+            MAILER=/usr/bin/icedove
+        elif [ -x /usr/bin/thunderbird ]; then
+            # fallback
+            MAILER=/usr/bin/thunderbird
+        fi
+        ;;
+esac

As we see if /usr/bin/xdg-email exists xdg-email is invoked. Do you have 
xdg-email installed?
$ dpkg -S /usr/bin/xdg-email
xdg-utils: /usr/bin/xdg-email

And that invokes stuff just fine:
$ xdg-email
<open evolutiono for me (probably because I never set my default mailer in GNOME 
to thunderbird)>
$ export MAILER=kmail; xdg-email
/usr/bin/xdg-email: 1: eval: kmail: not found
<would open kmail if I had it installed>

here it's probably unfortunate that both times it's MAILER, which confuses even 
me which one is taken where. Also something
prevented by either using sensible-lomua or xdg-email directly.

For senddoc, this is allowed:

profile libreoffice-senddoc /usr/lib/libreoffice/program/senddoc {
[...]
  /usr/bin/xdg-open     rPUx,
  /usr/bin/xdg-email    rPUx,
[...]
}

just tried it, LO send document as email -> evolution -> send works.
And evolution is - as kmail - not in the above allow list either.

2. if you configured someting else than sensible-lomua this indeed is not 
allowed, but you should use sensible-lomua and your KDE config (and/or set the 
MAILER environment variable, as I did above) and this probably works.
As said above, if you set "kmail" manually and don't use 
sensible-lomua/xdg-email machinery but get the pieces and need to allow kmail.

BTW:

I have zero interaction with AA except for this problem which reinstates itself randomly after updates so fixing it each time is a maximal waste of time.

What did you change? Even if you changed 
/etc/apparmor.d/usr.lib.libreoffice.program.senddoc then changes are kept/you 
get a dpkg prompt on the  upgrade. But for apparmor profiles this is bad since 
if stuff get added which are needed and you don't take them over....

All that tried on 25.2.2 on testing but stable definitely also has that 
sensible-lomua patch and the senddoc profile didn't change either.

Regards,

Rene

P.S: It's not helpful using gmail here since it silenly discards valid mail...

Reply via email to