xdg-email fails to attach filesnames with a comma "," to thunderbird

Bug #1823689 reported by Alex Hofmann
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Xdg-utils
New
Unknown
xdg-utils (Ubuntu)
Triaged
Low
Unassigned

Bug Description

When attaching a file to Thunderbird using xdg-email, it passes the full path to Thunderbird, as possible with TB3+. However, the syntax of TB uses the comma "," as filename separator. If a filename already contains a comma, Thunderbird will not find it and fails to attach it.

This could probably be fixed in Thunderbird, but would require them to change their command line syntax which is a big change. A different solution is to change from the "full path" syntax to "file://<path>" using a full URL-encodeing?

Example: the file is located at "/home/someuser/file, name.txt"

Calling xdg-email with "xdg-email --attach '/home/someuser/file, name.txt'" will produce (XDG_UTILS_DEBUG_LEVEL=1)

/usr/lib/thunderbird/thunderbird.sh -compose "attachment='/home/someuser/file, name.txt'"

And Thunderbird expects two files now, one "/home/someuser/file" and the other "name.txt". Instead

/usr/lib/thunderbird/thunderbird.sh -compose "attachment='file///home/someuser/file%2C%20name.txt'"

works.

As it turned out, not much needs to be changed. I created a crude patch to change from "file name scheme" to "uri scheme" against the version below with (for me) solves the issue. Note that I'm not a bash expert, so the solution might give room for improvement.

Some information:
>apt policy xdg-utils
xdg-utils:
  Installiert: 1.1.2-1ubuntu2.3
  Installationskandidat: 1.1.2-1ubuntu2.3

lsb_release will list Linux Mint Tess (19.1), upstream based on Ubuntu Bionic (hence the bug reported here)

Tags: patch
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report, could you report it also upstream on https://gitlab.freedesktop.org/xdg/xdg-utils/issues ?

Changed in xdg-utils (Ubuntu):
importance: Undecided → Low
Revision history for this message
Alex Hofmann (ubuntu-postkasten) wrote :

Sure, will do it later.

Meanwhile I found a few errors in my patch, so anybody trying it out, please use the new one attached below.

Revision history for this message
Alex Hofmann (ubuntu-postkasten) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "xdg-email.diff" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks!

Changed in xdg-utils (Ubuntu):
status: New → Triaged
Changed in xdg-utils:
status: Unknown → New
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.