Closed Bug 256314 Opened 16 years ago Closed 16 years ago

Wrong identity chosen when address contains +

Categories

(MailNews Core :: Composition, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: lhn+mozilla, Assigned: mnyromyr)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040626 Firefox/0.9.1
Build Identifier: version 0.7 (20040616)

I have a single account with half a dozen identities. Generally when I reply to
a message Thunderbird is smart and picks the right identity to reply from.
However Thunderbird always fails to pick the right identity when the address
involved contains a +

Reproducible: Always
Steps to Reproduce:
1. Create identity foo+bar@domain.org
2. Receive message addressed to foo+bar@domain.org
3. Reply to message. 
Actual Results:  
From: is incorrectly set to the default identity for the account.

Expected Results:  
Desired behavior is to have foo+bar@domain.org chosen for the From:. Note that
the following works just fine:

1. Create identity foo@domain.org
2. Receive message addressed to foo@domain.org
3. Reply to message.
4. From: is correctly set to foo@domain.org instead of the default identity for
the account.
FYI: the bug is unchanged in 1.0 (20041206).
Confirmed with TB nightly 1.0+ (20050609) on Win2k.
Status: UNCONFIRMED → NEW
Ever confirmed: true
This is also an issue in Mozilla trunk builds.
Component: Message Compose Window → MailNews: Composition
Product: Thunderbird → Core
Version: unspecified → Trunk
Blocks: 228980
The problem is the string method "search" used to test the addresses. Its
parameter is supposed to be a RegExp, not a string, thus email addresses with +
(and other RegExp modifiers) are treated as patterns: foo+bar@domain.org is
tested for "fo" + some"o"s + "bar@domain.org" - and fails.
Make sure a string search is performed by replacing the erroneous 'search' by
'indexOf'.
Assignee: mscott → mnyromyr
Status: NEW → ASSIGNED
Attachment #187254 - Flags: superreview?(bienvenu)
Attachment #187254 - Flags: review?(Stefan.Borggraefe)
Attachment #187254 - Flags: superreview?(bienvenu) → superreview+
Attachment #187254 - Flags: review?(Stefan.Borggraefe) → review+
Comment on attachment 187254 [details] [diff] [review]
replace erroneous search by indexOf

Suite + TB, low risk.
Attachment #187254 - Flags: approval1.8b3?
Attachment #187254 - Flags: approval-aviary1.1a2?
Attachment #187254 - Flags: approval1.8b3?
Attachment #187254 - Flags: approval-aviary1.1a2?
Attachment #187254 - Flags: approval-aviary1.1a2+
Checking in mailCommands.js;
new revision: 1.19; previous revision: 1.18
done

Checking in mailCommands.js;
new revision: 1.96; previous revision: 1.95
done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Product: Core → MailNews Core
No longer blocks: 228980
You need to log in before you can comment on or make changes to this bug.