mail messages mixup using exchange protocol - after move/delete the Subject is the one of the 2nd message, but the Sender and Body are from the 1st message.
Categories
(MailNews Core :: Networking: Exchange, defect, P2)
Tracking
(Not tracked)
People
(Reporter: giunta.gaetano, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(9 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:145.0) Gecko/20100101 Firefox/145.0
Steps to reproduce:
After moving (or deleting? I forgot the exact action) a mail message from the message list, and clicking on the message next to it, the message pane shows a curious mix-up: the Subject is the one of the 2nd message, but the Sender and Body are from the 1st message.
The error persists after shutting down and restarting TB.
This is using an Outlook365 account, TB 145.0 and the "Microsoft Exchange Mail Server" connection type.
Actual results:
| Reporter | ||
Comment 1•1 year ago
|
||
| Reporter | ||
Comment 2•1 year ago
|
||
PS: I tried the following: right-click the "Inbox" folder - choose "Properties" then "Repair Folder".
At first, it seemed as if the folder got wiped out - no messages were displayed.
Then the message list came back, but clicking on any message would not show up anything, just a blank message pane.
(This might be due to the fact that I'm on a slow 4G connection, bit it's still not a very friendly user experience I think. The interface could show some "loading" placeholder icon imho while data is loading instead of just an empty space...)
Finally, the message bodies started showing up. But still, when I click on the message with subject "[Circular Revolution Co-op CIC] Subscription Switched (4694) - 21 November 2025", I see the body of the message sitting just below it in the Inbox - which atm is not the one in the screenshot above, but another message...
Updated•1 year ago
|
| Reporter | ||
Comment 3•1 year ago
|
||
PPS: I have either moved to subfolders or deleted the messages which were showing signs of "mixup", but the issue is persisting - today I see it happening with fresh emails (see 2nd attachment picture)
| Reporter | ||
Comment 4•1 year ago
|
||
Comment 5•11 months ago
|
||
This looks like the local store is getting corrupted. I'm thinking this might indicate that we have an issue with synchronizing the local data store for the async threaded requests in the rust EWS client. Since it persists across a restart, this is not a temporary issue caused by the slow connection, but the slow connection may be showing us a thread synchronization issue. We need to investigate this one further.
| Reporter | ||
Comment 6•11 months ago
|
||
Do not hesitate to let me know if there's any more data I can provide to help deeper analysis of the corruption of the local store.
| Comment hidden (duplicate) |
Comment 8•11 months ago
|
||
I throttled my network connection and introduced a high probability of dropped packets and this is not reproducing for me. I'll try some other things, but it might not just be caused by network quality.
| Reporter | ||
Comment 10•11 months ago
|
||
FYI: I did manage to fix the corruption by: removing the account in TB, stopping TB, removing the on-disk folder "Mail/outlook.office365.com" within the TB profile, then starting TB and setting up the account again from scratch (TB did remember the password for that account, somewhat unexpectedly).
I have a backup copy of the "corrupted" Mail/outlook.office365.com folder, if it might help...
| Reporter | ||
Comment 11•11 months ago
|
||
...aaand, I got the corruption again.
The pattern to trigger it is the same: move a message from the outlook inbox to another folder, while messages are being downloaded (over a 4G connection).
I am not 100% sure about which messages where being downloaded at that exact moment, if it was the list of messages, the body of the message I was moving, or the body of the message next to it - I think that I quickly clicked on all the new messages in the inbox, without waiting for them to show up (ie. for their bodies to be fully downloaded and parsed), then moved one of the new messages.
Comment 12•11 months ago
|
||
ok, thanks for the update. I'm investigating this further today with network throttling to simulate the lower bandwidth connection.
| Reporter | ||
Comment 13•11 months ago
|
||
ps: it "feels" as if TB was first calculating the list of messages to be downloaded, based on their position in the inbox, then downloading their bodies and assigning them to the messages based on their list position, without checking that that the list contents had changed in the meantime
Comment 14•11 months ago
|
||
Every message has a unique EWS ID that we get when we first fetch the headers (prior to fetching the body). When we move a message, we get a list of the resulting IDs back in the order specified by the initial move request, and we use the EWS IDs to request message bodies and associate them with their headers, so at least in theory we shouldn't be relying on any list ordering there, but that's a good point.
Comment 15•11 months ago
•
|
||
Here's a hypothesis (although I haven't been able to reproduce it): A message move is a copy, which generates a new ID, followed by a delete, all on the server side (see the working with identifiers section of the page on EWS identifiers). Exchange identifiers are opaque, and our assumption so far is that you won't have the exact same identifier for two different messages. However, if that's not true, then it could be possible that if we download a body during a move at the exact time after the copy, but before the delete, and we're fetching another message's headers after the moved message's ID is deleted that somehow ends up with the same ID, then we would associate the fetched body with the newly fetched header. This would rely on our assumption of the uniqueness of IDs being wrong and a really strange timing occurrence. MS's documentation does not provide any indication of what goes into EWS IDs and whether they get reused by the server. We've base64 decoded them in the past and the only recognizable content is a uuid.
Comment 16•11 months ago
|
||
Are you using an mbox store or a maildir store? Mbox is the default, so if you didn't change it globally in settings (it's at the bottom of the General section), then you're using mbox.
Comment 18•11 months ago
|
||
Are you willing/able to share the headers for one of the problematic messages? If you want, you can send them to me directly, either via email (which would be legible to potential eavesdroppers unless you encrypt - I can send you a signed message if you want) or you can send them to me on Matrix.
| Reporter | ||
Comment 19•11 months ago
|
||
Sure, I can share the headers of the problematic messages - I just need instructions on how to extract them (is that the "view source" menu item?)
Comment 20•11 months ago
|
||
Yes, but that also includes the body. It'd be helpful to see both both header and body source, but if you're not comfortable sharing the body, you can just grab everything above where you recognize the body content starting. Thank you!!
| Reporter | ||
Comment 21•11 months ago
|
||
| Reporter | ||
Comment 22•11 months ago
|
||
| Reporter | ||
Comment 23•11 months ago
|
||
| Reporter | ||
Comment 24•11 months ago
|
||
I have uploaded the requested data.
The current situation is: there are 3 "mixed up" messages in the inbox. 2 of those show the same body (the "order 4783").
When clicking on "More -> View Source", then saving the source via "save page as...", I get the exact same contents for the two messages which show the same body - hence why I uploaded only the 2 headers files instead of 3.
PS: I just noticed that, every time a message mixup happened, one of the two messages involved was coming from "Microsoft 365 Message center". This might be just coincidence, but I wonder if those messages get generated/delivered in a different way... (going back to the hypothesis that the source of the problem might reside within the EWS ids...)
| Reporter | ||
Comment 25•11 months ago
|
||
| Reporter | ||
Comment 26•11 months ago
|
||
ps: I also attached the headers (and body) of one of the messages from MS Message center which does not present mixup issues, and which has a date close to a mixed-up message
| Reporter | ||
Comment 27•11 months ago
|
||
| Reporter | ||
Comment 28•11 months ago
|
||
| Reporter | ||
Comment 29•11 months ago
|
||
| Reporter | ||
Comment 30•11 months ago
|
||
pps: I just figured out that the Outlook web app also allows showing the message headers. So I downloaded the headers that it shows for the 3 messages that are mixed-up in TB and attached them as well (as a reminder: in the Outlook web app they show up with a body matching the sender and subject)
| Reporter | ||
Comment 31•11 months ago
|
||
ppps: another tidbit of info: when deleting in TB the mixed-up messages:
- in Outlook, they get sent to the Deleted Items folder
- in TB, they also get moved to the Deleted Items folder, and they keep showing the mixed-up body
Comment 32•11 months ago
|
||
This is all really helpful information, thank you so much! I'll keep you posted on what we find.
| Reporter | ||
Comment 33•9 months ago
|
||
FYI: I have now moved to using IMAP instead of EWS to access the given Outlook mailbox.
This has the slight discomfort of showing different folder names for some folders (due to Outlook shenanigans, I guess), and having to manually subscribe to see mail in all folders/subfolders, but so far has shown no sign of email header/body mixups.
As a side note: I read somewhere that EWS is being phased out by MS in favour of the Microsoft Graph API. How does that fit in TB's plans to support the EWS protocol?
Comment 34•9 months ago
|
||
Have you tried version 147 or higher? We made changes in 147 to improve concurrency in the operation queue that might address some of the issues you're seeing.
We are aware of the upcoming EWS phase out for Microsoft 365 and are currently implementing Microsoft Graph to continue support for Microsoft 365 accounts. For on-premises Exchange instances, Thunderbird will continue to support EWS as well. You can follow along with what we're currently working on for Graph in bug 1995835.
| Reporter | ||
Comment 35•9 months ago
|
||
I am not 100% sure about the timing, but I think I moved from EWS to IMAP on 14 or 15 Feb 2026.
I did make an archive of the EWS mailbox, and looking it up I can see that the latest email I had marked as "mixed up" was sent on 5/2/2026.
Which means that I was most likely using EWS version 147.0.1 at that time.
Updated•9 months ago
|
Description
•