Closed Bug 1878944 Opened 4 months ago Closed 2 months ago

Accept / Refuse mails notifications are not sent sometimes (because of case sensitive comparison between identity and attendee mail)

Categories

(Calendar :: E-mail based Scheduling (iTIP/iMIP), defect)

Thunderbird 115
defect

Tracking

(thunderbird_esr115 affected)

RESOLVED FIXED
127 Branch
Tracking Status
thunderbird_esr115 --- affected

People

(Reporter: merome, Assigned: gumara-dev)

References

Details

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:122.0) Gecko/20100101 Firefox/122.0

Steps to reproduce:

  1. From the mail client of your choice, send a calendar invitation to a TB user, let's say : firstname.lastname@domain.com
  2. As this TB user and from TB 115.6.0 (64 bits), accept the invitation and send a notification to the organizer, client-side scheduling is on, but the user's identity is written like that in thunderbird : Firstname.LASTNAME@domain.com
  3. Check the sent folder of the TB user

Actual results:

Accept and refuse notifications are not sent if the email address figuring in the attendee list of the invitation is not EXACTLY the same than the TB identity mail, case sensitive.
No error is displayed, and nothing could make you think your response has not been sent (you can only see that the sent folder does not contain your response).

Expected results:

The acceptation notification should be sent when attendee mail and TB identity mail are equals, case INsensitive.

If you add an identity corresponding to the attendee list, acceptation notification is actually sent, but you can't guess what the organizer will use as attendee mail for you : FIRSTNAME.LASTNAME@domain.COM or FIrstname.LAstname@domain.com, users are very inventive...

It's a silent bug, hard to detect, but extremely annoying for users.

Maybe related to https://bugzilla.mozilla.org/show_bug.cgi?id=1798268

After some other tests, I should add this precision :
It's not the identity mail address that should be exactly the same as the attendee email, but the calendar associated email.

I did some research on the source code and found this function :

 attendeeMatchesAddresses(aRefAttendee, aAddresses) {
    let attId = aRefAttendee.id;
    if (!attId.match(/^mailto:/i)) {
      // Looks like its not a normal attendee, possibly urn:uuid:...
      // Try getting the email through the EMAIL property.
      const emailProp = aRefAttendee.getProperty("EMAIL");
      if (emailProp) {
        attId = emailProp;
      }
    }

    attId = attId.toLowerCase().replace(/^mailto:/, "");
    for (const address of aAddresses) {
      if (attId == address.toLowerCase().replace(/^mailto:/, "")) {
        return true;
      }
    }

    return false;
  },

This function is called by buildOutgoingMessages() and should do the job case insensitive, but it's not working.

I have a calendar with this email address MYNAME@mydomain.com (uppercase) which is also in identities.
From Google I invite myname@mydomain.com (lowercase) to an event.
I receive the invitation, and I can accept it, choosing in which calendar I want to save it. The event is added to the calendar, but the acceptation is not sent. No error. Nothing in sent folder. Nothing in Google mailbox.

See Also: → 1889607

Found the real problem, see calItipUtils.sys.mjs:

https://searchfox.org/comm-central/rev/32757f5b99499c73d7ac144e531e02783632f2f8/calendar/base/modules/utils/calItipUtils.sys.mjs#1385

identity => identity.email == email

Only a simple check takes place here, the better code could be the following, for example:

identity => identity.email.toLowerCase() == email.toLowerCase()
Attached patch fix_bug1878944.patch (obsolete) — Splinter Review

Can you submit through phabricator? See https://developer.thunderbird.net/thunderbird-development/fixing-a-bug#submitting-a-patch
(Also, you can to the first lowercase where you assign email at first.)

(In reply to Magnus Melin [:mkmelin] from comment #4)

Can you submit through phabricator? See https://developer.thunderbird.net/thunderbird-development/fixing-a-bug#submitting-a-patch
(Also, you can to the first lowercase where you assign email at first.)

I will try it.

Assignee: nobody → info
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Target Milestone: --- → 127 Branch
Attachment #9396718 - Attachment is obsolete: true

Pushed by brendan@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/e4064f035b79
Fixing the sometimes not sent e-mail about the acceptance/rejection of appointments r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: