Open Bug 318364 Opened 19 years ago Updated 2 years ago

Multiple contacts with empty email address can't be on the same address list

Categories

(MailNews Core :: Address Book, defect)

defect

Tracking

(Not tracked)

People

(Reporter: chris, Unassigned)

References

(Depends on 1 open bug, )

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.8) Gecko/20051124 Ubuntu/1.4.99+1.5rc3.dfsg-1ubuntu3 Epiphany/1.9.2 Firefox/1.5
Build Identifier: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.8) Gecko/20051124 Ubuntu/1.4.99+1.5rc3.dfsg-1ubuntu3 Epiphany/1.9.2 Firefox/1.5

When adding multiple contacts with an empty email address field to a list, only one of them is added. This is particularly obvious when importing an LDIF file containing a group of multiple contacts without an email address.

There is obviously a check trying to compare the email address of the to-be-added contact with the existing ones, not adding email addresses already on the list.

Ideas to resolve this:

a) don't strcmp contact->email, but compare the contact object memory address when deciding whether a particular contact is already on the list when considering a contact to be added, thus allowing multiple contacts with the same email address on the same list. This is also the expected behavior when importing multiple contacts with the same email address, because lists work for instance in "The Bat!" like that.

b) encapsulate the existing contact->email checks into a
 if (strlen (contact_to_be_added->email) > 0)
branch. Still would be kind of fishy/unexpected when importing emails, but for the stable branch this would ensure to not break semantics for 1.0.x users where x <= 7.

PS: Whoever fixes this bug gets one GNOME bug fix for free :).

Reproducible: Always

Steps to Reproduce:
Attachment #204570 - Flags: review?
Comment on attachment 204570 [details] [diff] [review]
Proposed patch, untested

my guess is this won't work - probably want to check that newMail.Length() > 0
Attachment #204570 - Flags: review? → review?(bugzilla)
Comment on attachment 204570 [details] [diff] [review]
Proposed patch, untested

Thanks for the patch, however, this doesn't work. We now end up with two cards in the list with the same details in the list.

I think it is also incorrectly creating extra entries in the parent address book.

The problem being that AddListCardColumnsToRow is looking up an email address in the database for the card and not finding it.

That can probably be changed/corrected/improved with some thought.

BTW, patches that aren't security fixes won't be accepted for the 1.0.x branch (especially as 1.5 will soon be out) please can you try trunk versions in future, as that's where most patches will need to end up ;-) Thanks.
Attachment #204570 - Flags: review?(bugzilla) → review-
Confirming & Moving to core address book as it affects both Thunderbird & SeaMonkey.
Assignee: mscott → nobody
Status: UNCONFIRMED → NEW
Component: Address Book → MailNews: Address Book
Ever confirmed: true
Flags: review-
OS: Windows XP → All
Product: Thunderbird → Core
QA Contact: address-book → addressbook
Hardware: Other → All
Version: unspecified → Trunk
Comment on attachment 204570 [details] [diff] [review]
Proposed patch, untested

restoring r- that was lost when moving the bug between components (?).
Attachment #204570 - Flags: review-
*** Bug 246559 has been marked as a duplicate of this bug. ***
Depends on: 189895
This bug prevents moving my mother's business to using Thunderbird on Linux.  I had to buy Windows instead...
*** Bug 333317 has been marked as a duplicate of this bug. ***
Blocks: 333317
Product: Core → MailNews Core
Rereading the comments, I discovered that several duplicates of this BUG have been submitted over the years and at least one other customer has left.

You can not trust the drag and drop interface because once an incorrect address was added and removed, the email address can not be dragged to the list (no error noted). I represent two new customers who need accurate mailing lists.  This is not a minor BUG!!

If this BUG does not get attention we will find another solution.  Also a happy user of Firefox.
Echoing Jerry above, "This is not a minor BUG!!". These lists/groups are currently TB's only plausible bit of UI for telling the computer about the categories people fall into. And they very nearly work. This problem is blocking a whole range of information-filtering scenarios (for normal users and app developers).

Also the original description above is wrong. Maybe it was right 5 years ago...

"When adding multiple contacts with an empty email address field to a list"

 - not so - it also happens when adding people one by one

"There is obviously a check trying to compare the email address of the
to-be-added contact with the existing ones, not adding email addresses already
on the list."

 - not sure about this either. When you add more after adding a no-email record, the new stuff is somehow record. You can verify this in 3b2 by looking at the property sheet. 

See also my writeup of this bug, https://bugzilla.mozilla.org/show_bug.cgi?id=480817 for steps to reproduce.

(I've tried to dig into the Mork db to see what the actual structure is, but no joy.)
Removing myslef on all the bugs I'm cced on. Please NI me if you need something on MailNews Core bugs from me.
Severity: minor → S4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: