Closed Bug 1577117 Opened 2 years ago Closed 2 years ago

command line argument "attachment" (of command "-compose") is not working

Categories

(Thunderbird :: OS Integration, defect)

defect
Not set
normal

Tracking

(thunderbird_esr6869+ fixed, thunderbird69 wontfix, thunderbird70 fixed)

RESOLVED FIXED
Thunderbird 70.0
Tracking Status
thunderbird_esr68 69+ fixed
thunderbird69 --- wontfix
thunderbird70 --- fixed

People

(Reporter: klaus.riech, Assigned: jorgk-bmo)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Firefox/68.0

Steps to reproduce:

I sent a windows shell command (to be precise using the VBA command "shell"):
C:\Program Files (x86)\Mozilla Thunderbird\Thunderbird.exe -compose "to='test@gut-cert.de',cc='',subject='mysubject',body='Dear Mr Test',attachment='C:\test.txt' "

Actual results:

Thunderbird opens. A new Mail is created.
The Mail is completely empty, no TO, not SUBJECT, no BODY - and nothing attached.

If I remove the command line argument "attachment". The Mail opens perfectly normal with TO, SUBJECT and BODY.

Expected results:

The Mail should have been created with TO ("test@gut-cert.de"), SUBJECT ("mysubject"), BODY ("Dear Mr Test") and the file "test.txt" attached to it.

Thanks for filing the bug

Component: Untriaged → OS Integration

Hmm. Apparently because Cc["@mozilla.org/toolkit/command-line;1"] is gone.

Status: UNCONFIRMED → NEW
Ever confirmed: true

Sigh, we use:
let commandLine = Cc["@mozilla.org/toolkit/command-line;1"]
https://searchfox.org/comm-central/rev/753e6d9df9d7b9a989d735b01c8b280eef388bab/mail/components/compose/content/MsgComposeCommands.js#2676

And that XPCOM API has disappeared from M-C in bug 1491560: https://hg.mozilla.org/mozilla-central/rev/7a4dadc9c3e6

So we need to restore this.

Regressed by: 1491560

This will do it: Cu.createCommandLine().
EDIT: From https://hg.mozilla.org/mozilla-central/rev/7a4dadc9c3e6#l3.12

Works fine locally, I used:
thunderbird.exe -compose "to=test@gut-cert.de,subject=mysubject,body='Dear Mr Test',attachment=D:\Desktop\BVG-Preise-2016.pdf "

Assignee: nobody → jorgk
Status: NEW → ASSIGNED
Attachment #9088694 - Flags: review?(mkmelin+mozilla)
Attachment #9088694 - Flags: approval-comm-esr68+
Attachment #9088694 - Flags: approval-comm-beta+
Target Milestone: --- → Thunderbird 70.0

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/bcc11bb0ae6c
create command line via Cu.createCommandLine() after bug 1491560. r=me

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Comment on attachment 9088694 [details] [diff] [review]
1577117-command-line.patch

Review of attachment 9088694 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, thx! r=mkmelin
Attachment #9088694 - Flags: review?(mkmelin+mozilla) → review+

Related to this, I think it was unnoticed because at https://searchfox.org/comm-central/rev/753e6d9df9d7b9a989d735b01c8b280eef388bab/mail/components/compose/content/MsgComposeCommands.js#3047 we don't really get a prompt, only the "Cannot call openModalWindow on a hidden window" error.

Hmm, well, no one uses -compose " ... attachment= ..." on Daily or Beta. I tried in on 68.1, works fine again.
EDIT: I see, you mean the debug console doesn't show it. Right.

Attachment #9088694 - Flags: approval-comm-beta+
Duplicate of this bug: 1578180
Duplicate of this bug: 1578657
Duplicate of this bug: 1579370
Duplicate of this bug: 1579533
Duplicate of this bug: 1579741
Duplicate of this bug: 1580119
See Also: → 678521
You need to log in before you can comment on or make changes to this bug.