Some "-compose" command line options won't work if they are the first or only argument

RESOLVED FIXED in Thunderbird 3.3a3

Status

MailNews Core
Composition
RESOLVED FIXED
7 years ago
5 years ago

People

(Reporter: sphakka, Assigned: rsx11m)

Tracking

(Blocks: 2 bugs, {fixed-seamonkey2.0.14})

Trunk
Thunderbird 3.3a3
fixed-seamonkey2.0.14
Dependency tree / graph

Thunderbird Tracking Flags

(thunderbird3.1 .10-fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

7 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20110105 Gentoo/2.0.11-r2 SeaMonkey/2.0.11
Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20110105 Gentoo/2.0.11-r2 SeaMonkey/2.0.11

Hi there,
The command line 

  -compose 'bcc=foo@bar'" 

doesn't fill a "Bcc:" address line, as it happens with 'cc=foo@bar'.
Cheers,
  ^m'e

Reproducible: Always

Steps to Reproduce:
1. type on a console terminal "$ seamonkey -compose 'bcc=foo@bar'"

Actual Results:  
a mail compose window opens, but no 'Bcc:' address line is filled in.

Expected Results:  
a mail compose window opens with a 'Bcc:' address line showing 'foo@bar'.

Maybe the doc is incomplete here:

<https://developer.mozilla.org/en/Command_Line_Options#Syntax_Rules>

I'd actually expect that the command line option "-compose '<header>=blah'"
would correctly fill any available '<header>' field. It actually works only with 'to' and 'cc', *unless* a 'subject' field is provided as in:

  $ seamonkey -compose 'subject=blah,bcc=foo@bar.net'

weird...
(Assignee)

Comment 1

7 years ago
I can reproduce on both Windows and Linux 2.0.11 releases, yet have to try on trunk. Note that the workaround with adding a Subject only does the trick if "subject=" comes before "bcc=", tried it the other way around and it didn't fill either of the Subject nor Bcc headings. Nothing in the Error Console.
(Assignee)

Comment 2

7 years ago
Confirmed on trunk as well as in Thunderbird, thus moving to MailNews Core.
Status: UNCONFIRMED → NEW
Component: MailNews: Composition → Composition
Ever confirmed: true
OS: Linux → All
Product: SeaMonkey → MailNews Core
QA Contact: mailnews-composition → composition
Hardware: x86_64 → All
Summary: command line "-compose 'bcc=foo@bar'" doesn't fill a "Bcc:" line → command line "-compose 'bcc=foo@bar'" doesn't fill a "Bcc:" line if it is the first or only argument
Version: unspecified → Trunk
(Assignee)

Comment 3

7 years ago
Created attachment 506529 [details] [diff] [review]
Ad-hoc fix

This is untested but should fix it. The underlying problem is that the begin of the argument for "-compose" is tested against a couple of expected strings, and that "bcc" is missing in this list. Thus, nsMsgComposeService::Handle() ignores the argument if it starts with "bcc=..." rather than any of the other strings.
Attachment #506529 - Flags: review?(neil)
(Reporter)

Comment 4

7 years ago
IMHO, the list of supported matching fields should be the same as that appearing in the compose window (to, cc, bcc, reply-to, ... -- please, provide a way to probe it, via, f.i., an option '-compose help'), irrespective of the order.
Ideally, if

  $ mozilla -copose help

says:

  supported fields:
    foo
    bar
    quux

then one should be able to call it like

  $ mozilla -compose 'quux=blah,bar=whatever,foo=...' ...

or, if multiple homonymous options are supported, like

  $ mozilla -compose 'quux=blah' -compose 'bar=whatever' -compose 'foo=...' ...

Thanks!

  ^m'e
(Assignee)

Comment 5

7 years ago
Updating the command-line help across the board may be another bug, but I'm not even sure which other arguments for fields not given in that list may apply. "Reply-to" is usually set in the account identity.
(Assignee)

Comment 6

7 years ago
I've tested some further arguments visible in the composition window, but
neither "newsgroup", "reply-to", "followup-to", or "from" does anything, even after a subject. Thus, "bcc" seems to be the only one that needs to be added.
(Assignee)

Comment 7

7 years ago
While trying to find any existing tests for command-line options which I could expand I came across bug 540330, so nothing in this regards has been done yet and testing these functions is still waiting for a broader solution.

Thus, the patch in attachment 506529 [details] [diff] [review] remains for review as posted.
Assignee: nobody → rsx11m.pub

Comment 8

7 years ago
(In reply to comment #6)
> I've tested some further arguments visible in the composition window, but
> neither "newsgroup", "reply-to", "followup-to", or "from" does anything, even
> after a subject. Thus, "bcc" seems to be the only one that needs to be added.

We support bodyislink, type, format, originalMsg, preselectid, identity, to, cc, bcc, newsgroups, subject, attachment, newshost, body. I'm not sure that they're all useful though.

Comment 9

7 years ago
Comment on attachment 506529 [details] [diff] [review]
Ad-hoc fix

Feel free to post a new patch if you want to support other parameters.
Attachment #506529 - Flags: review?(neil) → review+
(Assignee)

Comment 10

7 years ago
(In reply to comment #8)
> We support bodyislink, type, format, originalMsg, preselectid, identity, to,
> cc, bcc, newsgroups, subject, attachment, newshost, body.

I didn't imagine that something as complex like "preselectid" would be needed to specify the "from" address. ;-) It works with "preselectid=id2" though not very intuitive (the user has to look up or guess the identity key).

I had used "newsgroup" as labeled instead of "newsgroups", the latter works and is certainly desired to allow for composing newsgroups articles.

The only other useful argument appears to be "format=1" (compose in HTML) vs. "format=2" (open in plain text) which could be used in an automated way.

I'll update the patch later today.
Summary: command line "-compose 'bcc=foo@bar'" doesn't fill a "Bcc:" line if it is the first or only argument → Some "-compose" command line options won't work if they are the first or only argument
(Assignee)

Comment 11

7 years ago
Created attachment 507520 [details] [diff] [review]
Patch for check-in
[Checked in: Comment 12 & 23 & 25]

Additions per comment #10, r=Neil from attachment 506529 [details] [diff] [review].
The strings are sorted to reflect their order in the composition window.

Please see comment #7 regarding open tests for command-line options.
This doesn't seem to need superreview, thus requesting push on trunk.
Attachment #506529 - Attachment is obsolete: true
Attachment #507520 - Flags: review+
(Assignee)

Updated

7 years ago
Keywords: checkin-needed
Whiteboard: [c-n: comm-central]
Checked in: http://hg.mozilla.org/comm-central/rev/e3022c07fb50
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Whiteboard: [c-n: comm-central]
Target Milestone: --- → Thunderbird 3.3a3
(Assignee)

Comment 13

7 years ago
Thanks, works fine in Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b11pre) Gecko/20110201 Thunderbird/3.3a3pre and Mozilla/5.0 (X11; Linux x86_64; rv:2.0b11pre) Gecko/20110201 Thunderbird/3.3a3pre nightly builds; SeaMonkey
nightly builds didn't pick the patch up yet, thus check tomorrow.

(In reply to comment #4)
> IMHO, the list of supported matching fields should be the same as that
> appearing in the compose window (to, cc, bcc, reply-to, ... -- please, provide
> a way to probe it, via, f.i., an option '-compose help'), irrespective of the
> order.

sphakka, if you want to please file a new bug on this suggestion, or I can file it on your behalf if you prefer.
(Assignee)

Comment 14

7 years ago
(actually, those would be two bugs: changing the option names to match the composition window, and expanding the commandline help to explain using them.)
(Reporter)

Comment 15

7 years ago
Done, see #627999 and #630802.
(Reporter)

Comment 16

7 years ago
oops, it's #630804, not 627999 of course...
(Assignee)

Comment 17

7 years ago
Thanks, I've just confirmed both of them.
Blocks: 630802, 630804
(Assignee)

Comment 18

7 years ago
Comment on attachment 507520 [details] [diff] [review]
Patch for check-in
[Checked in: Comment 12 & 23 & 25]

This works fine on trunk and should be safe for the release branches. No bugs related to command-line invocation or Simple MAPI (except for bug 631524 which has shown to be unrelated to this fix) have been filed over the last two weeks.

The patch applies cleanly to both comm-1.9.1 and comm-1.9.2; even though it's not strictly a security or stability fix, it should avoid any "Oops?" effect for users trying to utilize command-line arguments for composition while in turn not affecting existing scripts which are working around the issue already.
Attachment #507520 - Flags: approval-thunderbird3.1.9?
Attachment #507520 - Flags: approval-seamonkey2.0.13?

Comment 19

7 years ago
Comment on attachment 507520 [details] [diff] [review]
Patch for check-in
[Checked in: Comment 12 & 23 & 25]

I'm usually very reluctant to take anything in a stable branch that looks feature-ish but this looks very safe, so let's do it.
Attachment #507520 - Flags: approval-seamonkey2.0.13? → approval-seamonkey2.0.13+
(Assignee)

Comment 20

7 years ago
Mark, https://wiki.mozilla.org/Tree_Rules/comm-central hasn't been updated yet
to reflect that Thunderbird 3.0.x is no longer continued. Thus, Thunderbird shouldn't be affected by what's happening in SeaMonkey 2.0.x; meaning, is
KaiRo's branch approval sufficient to land this on comm-1.9.1 or will it have
to wait until branch approval is decided for Thunderbird 3.1.x as well?
(Assignee)

Comment 21

7 years ago
Since Thunderbird didn't object, push for SeaMonkey 2.0.13 please.
Keywords: checkin-needed
Whiteboard: [c-n: comm-1.9.1, default branch]
(Assignee)

Comment 22

6 years ago
Ok, so this will probably be pushed back to SM 2.0.14 and TB 3.1.11 for the release branches, based on what I read in bug 643216.
Attachment #507520 - Flags: approval-thunderbird3.1.10? → approval-thunderbird3.1.10+
(Assignee)

Updated

6 years ago
Whiteboard: [c-n: comm-1.9.1, default branch] → [c-n: comm-1.9.1 and comm-1.9.2, default branches]
Checked in for 3.1.10: http://hg.mozilla.org/releases/comm-1.9.2/rev/801fdd177a6b

You'll need a SeaMonkey person to do the 1.9.1 branch.
status-thunderbird3.1: --- → .10-fixed
Whiteboard: [c-n: comm-1.9.1 and comm-1.9.2, default branches] → [c-n: comm-1.9.1, default branches]
(Assignee)

Comment 24

6 years ago
Thanks Mark.

Serge, Callek: Can you push this on comm-1.9.1 for SeaMonkey to pick up?
Keywords: checkin-needed → fixed-seamonkey2.0.14
Whiteboard: [c-n: comm-1.9.1, default branches]
Comment on attachment 507520 [details] [diff] [review]
Patch for check-in
[Checked in: Comment 12 & 23 & 25]

http://hg.mozilla.org/releases/comm-1.9.1/rev/7dfc717a9eac
Attachment #507520 - Attachment description: Patch for check-in → Patch for check-in [Checked in: Comment 12 & 23 & 25]

Updated

5 years ago
Duplicate of this bug: 549058
You need to log in before you can comment on or make changes to this bug.