xdg-email fails to add attachment with Thunderbird

Bug #1401632 reported by Jody on 2014-12-11
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
xdg-utils (Ubuntu)
Undecided
Unassigned

Bug Description

Attachment is not added even though I can attach files from command-line using the following command thunderbird -remote "xfeDoCommand(composeMessage,subject='S',<email address hidden>',body='B',attachment='/some/absolute/file.txt')"

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: xdg-utils 1.1.0~rc1-2ubuntu7.1
ProcVersionSignature: User Name 3.13.0-40.69-generic 3.13.11.10
Uname: Linux 3.13.0-40-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.6
Architecture: amd64
CurrentDesktop: Unity
Date: Thu Dec 11 10:24:08 2014
InstallationDate: Installed on 2014-09-18 (83 days ago)
InstallationMedia: Ubuntu 14.04.1 LTS "Trusty Tahr" - Release amd64 (20140722.2)
PackageArchitecture: all
SourcePackage: xdg-utils
UpgradeStatus: No upgrade log present (probably fresh install)

Jody (douglas41) wrote :
Launchpad Janitor (janitor) wrote :

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

Changed in xdg-utils (Ubuntu):
status: New → Confirmed
Jody (douglas41) wrote :

This is what I get when I run:

jody@ubuntu:~$ XDG_UTILS_DEBUG_LEVEL=100 xdg-email --attach ~/Desktop/keys.txt

DE is "gnome"
grep: /home/jody/.local/share/applications/: Is a directory
Running gvfs-open "mailto:?attach=/home/jody/Desktop/keys.txt"

Paq (paq1) wrote :

This is also an issue with Ubuntu 12.04. It is also likely a duplicate of a few other bugs:

https://bugs.launchpad.net/ubuntu/+source/xdg-utils/+bug/1277884
https://bugs.launchpad.net/ubuntu/+source/simple-scan/+bug/515386

The problem appears to be with a few bugs in /usr/bin/xdg-email:

#1: The function desktop_file_to_binary() runs a grep command which attempts to extract the name of the email executable from ~/.local/share/applications/thunderbird.desktop by finding a line in it which begins "Exec=thunderbird <args>". Unfotunately, there are several of these matching lines in the thunderbird.desktop file:

Exec=thunderbird %u
Exec=thunderbird -compose
Exec=thunderbird -addressbook

The grep command finds all of them, and the subsequent call to "which" to find the executable looks for a program called "thunderbird thunderbird thunderbird". This can be fixed by adding a "-m 1" flag to the grep command to stop at the first instance.

#2: In the function open_gnome(), it calls desktop_file_to_binary() with the argument $browser when it should use the argument $desktop. (The function open_lxde() calls desktop_file_to_binary() correctly with $desktop.)

Both of these observations were pointed out previously in:
https://bugs.launchpad.net/ubuntu/+source/simple-scan/+bug/515386/comments/44

After making these two changes, xdg-email correctly calls
    /usr/lib/thunderbird/thunderbird.sh -compose "attachment='<filename>'"
instead of
    gvfs-open "mailto:?attach=<filename>"

The problem has nothing to do with thunderbird's inability to handle mailto: attachments.

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

Other bug subscribers