Closed Bug 1170002 Opened 9 years ago Closed 9 years ago

Display-name with comma in it does not get properly quoted in From: field

Categories

(SeaMonkey :: MailNews: Composition, defect)

SeaMonkey 2.35 Branch
defect
Not set
normal

Tracking

(seamonkey2.35 fixed, seamonkey2.36 fixed, seamonkey2.37 fixed, seamonkey2.38 fixed)

RESOLVED FIXED
seamonkey2.38
Tracking Status
seamonkey2.35 --- fixed
seamonkey2.36 --- fixed
seamonkey2.37 --- fixed
seamonkey2.38 --- fixed

People

(Reporter: neil, Assigned: neil)

References

Details

(Keywords: regression)

User Story

https://hg.mozilla.org/comm-central/rev/3e3e006f4246         SeaMonkey 2.38
Was merged to comm-aurora SeaMonkey 2.38
http://hg.mozilla.org/releases/comm-beta/rev/e63206c2ff6e    SeaMonkey 2.37
http://hg.mozilla.org/releases/comm-release/rev/e337a5714b5a SeaMonkey 2.36
http://hg.mozilla.org/releases/comm-release/rev/bfda05b73e50 SeaMonkey 2.35 SEAMONKEY_2_35_RELEASE_BRANCH

Attachments

(1 file)

The From field is copied to and from the compose params, but this is incorrect because the compose params expects a decoded MIME header while the From field is a display address.

This affects anyone whose MIME header needs to be quoted, e.g. because it contains a comma.
Attached patch Proposed patchSplinter Review
We also have to set the From address on startup correctly too, otherwise the address will be unexpectedly quoted. (Which does mean that if you don't need to change identity then the email will at least send correctly.)

I used .join("") because parseDecodedHeader returns an array but [0].toString() would also work if you prefer.
Assignee: nobody → neil
Status: NEW → ASSIGNED
Attachment #8613289 - Flags: review?(philip.chee)
Comment on attachment 8613289 [details] [diff] [review]
Proposed patch

(In reply to neil@parkwaycc.co.uk from comment #1)
> I used .join("") because parseDecodedHeader returns an array but
> [0].toString() would also work if you prefer.
I prefer [0].toString()

Also please fix typographical errors in your patch:
> -      msgCompFields.from = GetMsgIdentityElement().value;
> +      var address = GetMsgIdenityElement().value;
s/GetMsgIdenityElement/GetMsgIdentityElement/
> +      address = MailServices.headerParser.makeFromDisplayAddress(address);
> +      msgCompFields.from = MailServices.headerparser.makeMimeHeader(address, 1);
s/MailServices.headerparser/MailServices.headerParser/
Attachment #8613289 - Flags: review?(philip.chee) → review+
Pushed comm-central changeset 3e3e006f4246.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.38
Comment on attachment 8613289 [details] [diff] [review]
Proposed patch

[Approval Request Comment]
Regression caused by (bug #): 87987/1140640
User impact if declined: Can't use special characters in identity
Testing completed (on m-c, etc.): Landed on c-c
Risk to taking this patch (and alternatives if risky): Low
String changes made by this patch: None
Attachment #8613289 - Flags: approval-comm-release?
Attachment #8613289 - Flags: approval-comm-beta?
Attachment #8613289 - Flags: approval-comm-aurora?
Comment on attachment 8613289 [details] [diff] [review]
Proposed patch

a=me
Attachment #8613289 - Flags: approval-comm-release?
Attachment #8613289 - Flags: approval-comm-release+
Attachment #8613289 - Flags: approval-comm-beta?
Attachment #8613289 - Flags: approval-comm-beta+
Attachment #8613289 - Flags: approval-comm-aurora?
Attachment #8613289 - Flags: approval-comm-aurora+
User Story: (updated)
You need to log in before you can comment on or make changes to this bug.