Bug 1890230 Comment 45 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I'm increasingly thinking that it's _not_ a case of the mbox writing getting screwed up, but something else (Gene's comment #44 kind of adds a bit of weight to that too).
mbox totally ignores multipart structures and treats the whole message as a header block followed by a body block (any multipart stuff is contained within the body block, and handled elsewhere).

But the problem we're seeing here seems to be _very_ aligned to multipart parts:

1. The displayed bodies of all the reported cases here seem to start very precisely at a multipart boundary (eg Comment #9, Comment #37).
2. We can see multiple parts of the message (Comment #37)
3. The first visible part in the borked multipart message doesn't always seem to be the text/plain (or even text/html) parts. Sometimes it's image/png, which you would not expect to see at the start of a message - rather it looks like an attachment or inline (as in Comment #9).
4. I _think_ the reported cases display blank values for To:, From:, Subject: etc...

It kind of feels like IMAP is occasionally skipping the first part (or parts) of messages - that's what 1, 2 and 3 look like.
Given that all the email headers (To/From/Subject etc) are in the top-level root part, skipping the beginning of it would leave the header parser (which builds the entry in the msg database) with blank values, which looks like 4.
I'm not saying that's what's happening, but it describes the kind of borkage we see.

Annoyingly, I still can't replicate this myself :-(
[EDIT: I'm pretty sure the mime-boundary thing here is a red herring. I think it's an artifact of how the display code handles being fed data starting part-way through the message. It assumes that there message begins with a block of headers, and attempts to parse them until it sees a blank line to denote the start of the message body. Statistically the first blank line is very likely to be because of a mime block, hence the separator being interpreted as the start of the message body.]

I'm increasingly thinking that it's _not_ a case of the mbox writing getting screwed up, but something else (Gene's comment #44 kind of adds a bit of weight to that too).
mbox totally ignores multipart structures and treats the whole message as a header block followed by a body block (any multipart stuff is contained within the body block, and handled elsewhere).

But the problem we're seeing here seems to be _very_ aligned to multipart parts:

1. The displayed bodies of all the reported cases here seem to start very precisely at a multipart boundary (eg Comment #9, Comment #37).
2. We can see multiple parts of the message (Comment #37)
3. The first visible part in the borked multipart message doesn't always seem to be the text/plain (or even text/html) parts. Sometimes it's image/png, which you would not expect to see at the start of a message - rather it looks like an attachment or inline (as in Comment #9).
4. I _think_ the reported cases display blank values for To:, From:, Subject: etc...

It kind of feels like IMAP is occasionally skipping the first part (or parts) of messages - that's what 1, 2 and 3 look like.
Given that all the email headers (To/From/Subject etc) are in the top-level root part, skipping the beginning of it would leave the header parser (which builds the entry in the msg database) with blank values, which looks like 4.
I'm not saying that's what's happening, but it describes the kind of borkage we see.

Annoyingly, I still can't replicate this myself :-(

Back to Bug 1890230 Comment 45