commas in attachment filenames on the command line result in truncated filenames



11 years ago
7 years ago


(Reporter: pgoerzen, Unassigned)


Firefox Tracking Flags

(Not tracked)




11 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20080404 Iceweasel/ (Debian-
Build Identifier: version (20080420)

When specifying an attachment on the command line, the filename gets truncated if it contains a comma. Attaching from the GUI is not a problem.'s send as xxxx functionality uses the command line as follows:

"thunderbird" "-compose" "attachment=file:///path/to/file, with commas.pdf"

The filename listed in the attachments pane contains no text after or including the comma. Attempting to send results in an error since the file can't be found.

Reproducible: Always

Steps to Reproduce:
1. Create a file "hi,everybody.odt"
2. thunderbird -compose "attachment=file:///home/user/hi,everybody.odt"
3. Enter an email address and subject. Hit send
Actual Results:  
Attachment filename gets truncated to "hi" and fails to send.

Expected Results:  
Attachment filename should be "hi,everybody.odt" and should send properly.

Comment 1

11 years ago
I can reproduce your observation, however this appears to be a syntax issue with the command line rather than an actual truncation of the file path.

In the comma indicates a separation of options, all of which are passed as a single argument enclosed in "" quotes. Using the comma within a file name gives me an error message "An error occurred while creating a message compose window" when putting the file URI into single quotes as instructed by the Syntax Rules.

Tested on (Windows/20080421), yet have to check in trunk.

Comment 2

11 years ago
Ok, now I see what's happening. If you have a sequence "option='test1,test2'" in the command line, it will treat this as a parameter of type "option" where the arguments for that option are "test1" and "test2". You can try this with "attachment='file:...,file:...'" and you get two attachments.

Thus, without the single-quoting inside the "attachment" parameter, the "everybody.odt" part is used as another option, which doesn't match anything though. If you use the '-quotes, the first argument is a correct "file:" URI, whereas "everybody.odt" is an incorrect URI, therefore giving an error.

The question is whether or not this is actually a bug, given that the syntax rules do not allow to specify arguments to an option which contain commas due to the ambiguity (we would have three levels of comma then).

Comment 3

11 years ago
Sorry for not seeing this earlier, but - of course - you can define a comma in an URI so that it doesn't get confused with the option/argument separators, just use the hexadecimal equivalent:

thunderbird -compose "attachment='file:///home/user/hi%2Ceverybody.odt'"

This should do it.
-> WFM
Last Resolved: 11 years ago
Resolution: --- → WORKSFORME


7 years ago
Duplicate of this bug: 743579

Comment 5

7 years ago
Please see my post at 743579
You need to log in before you can comment on or make changes to this bug.