Comment 30 for bug 1748895

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.