Closed Bug 1610798 Opened 5 years ago Closed 5 years ago

Thunderbird ignores second command line argument for attachments

Categories

(Thunderbird :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: bdonauba, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

Steps to reproduce:

Enter a command line like this in a Linux terminal:

thunderbird -compose to="info@gmail.com" ,subject="SubjectText" ,body="bodytext" ,attachment='/tmp/File.txt,/tmp/File2.txt'

Actual results:

Thunderbird opens but attaches only the first file.

Expected results:

Thunderbird should attach both files.

This feature es mentioned here:
https://stackoverflow.com/questions/27836576/adding-several-attachments-to-thunderbird-from-command-line

Thomas can you reproduce?

Component: Untriaged → General
Flags: needinfo?(bugzilla2007)

Needs someone to test under Linux, where ,attachment='/tmp/File.txt,/tmp/File2.txt' should probably work for files under root directory.
Delicate stuff. Probably dozens of ege cases which can fail.

All of the following work for me under Windows:

"C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe" -compose "to='info@gmail.com',subject='SubjectText',body='bodytext',attachment='c:\schrott\susibar.txt,c:\schrott\susifoo.txt'"

"C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe" -compose to="info@gmail.com" ,subject="SubjectText" ,body="bodytext" ,attachment='c:\schrott\susibar.txt,c:\schrott\susifoo.txt'

"C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe" -compose to="info@gmail.com",subject="SubjectText",body="bodytext",attachment='c:\schrott\susibar.txt,c:\schrott\susifoo.txt'


Fails (total fail, syntax, spaces after comma)
"C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe" -compose to="info@gmail.com", subject="SubjectText", body="bodytext", attachment='c:\schrott\susibar.txt,c:\schrott\susifoo.txt'

Fails (second attachment lost, double quotes without single quotes for attachment)
"C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe" -compose to="info@gmail.com",subject="SubjectText",body="bodytext",attachment="c:\schrott\susibar.txt,c:\schrott\susifoo.txt"

Fails (second attachment lost, double quotes with single quotes for attachment)
"C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe" -compose to="info@gmail.com",subject="SubjectText",body="bodytext",attachment="'c:\schrott\susibar.txt','c:\schrott\susifoo.txt'"

Flags: needinfo?(bugzilla2007)

I tried it today again and found out it works if you start thunderbird this way:

thunderbird -compose "to='info@gmail.com',subject='Subject Text',body='body text',attachment='/tmp/File.txt,/tmp/File2.txt'"

In a bash script one can even use a array with filenames:

to="info(at)gmail.com"
subject="subject text"
body="$body"

f[0]=/tmp/File.txt
f[1]=/tmp/File2.txt

thunderbird -compose "to='$to',subject='$subject',body='body text',attachment='$(IFS=, eval 'echo "${f[*]}"')'"

worksforme per my extensive analyis in comment 2 and reporter's confirmation in comment 3.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.