Bug: Rebuilding index on mbox file always sees "From " as starting a new message
Status: RESOLVED
Priority: --
Resolution: INVALID
Created: 2023-06-16 02:42:08+00:00
Resolved: 2023-06-16 09:49:41+00:00

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

Steps to reproduce:

(Seen on Linux; not tested using Windows. Thunderbird version 102.12.0)

I use Proton Mail but like to have my messages stored locally and accessible using Thunderbird. I could use their bridge software, but that option's available only for paid accounts and currently for me money is extremely tight. So I save new messages using Proton's "export" feature, then use a simple script to add an mbox-style "From" separator line and append the saved message to a local mbox file. Restarting Thunderbird causes it to see the file has been changed, and it rebuilds the index.

The bug: If a line in a message happens to start with "From" followed by a space, Thunderbird mistakenly believes it's the start of a new message, even if the line appears within a MIME part.

Steps to reproduce:

 1. In Thunderbird, select Menu -> Help -> More Troubleshooting Information
 2. At "Profile Directory," click on "Open Directory"
 3. Close Thunderbird
 4. In your system's file manager, open the folder named "Mail"
 5. In the "Mail" folder, click on the folder named "Local Folders"
 6. In the "Local Folders" folder, create a new text file called "Bug Demo". You can keep the .txt extension, change it to .mbox, or have no extension at all
 7. Put the following text into the "Bug Demo" file:

----- cut here -----
From babbage@difference-engine.net Thu Jun 15 02:58:11 2023 +0000
From: Charles Babbage <babbage@difference-engine.net>
To: Thunderbird Bugzilla <thunderbird@bugzilla.mozilla.org>
Date: Wed, 14 Jun 2023 22:58:11 -0400
Subject: Wrong numbers, right answers?
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=_----------1686795813

This is a multi-part message in MIME format.
--_----------1686795813
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
Content-Type: text/plain

On two occasions I have been asked, --"Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" In one case a member of the Upper, and in the other a member of the Lower, House put this question. I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.

From my book "Passages from the Life of a Philosopher" (1864), chapter 5 "The Difference Engine."

Charles Babbage (26 December 1791 - 18 October 1871) was an English mathematician and analytical philosopher who originated the idea of a programmable computer. Ada Lovelace worked for him.

For more information, see Wikipedia: https://en.wikipedia.org/wiki/Charles_Babbage
--_----------1686795813--
----- cut here -----

 8. Save the file. You can safely close the file manager.
 9. Start Thunderbird


Actual results:

The "Bug Demo" folder under "Local Folders" has two messages:

 1. A message from Charles Babbage with the subject line "Wrong numbers, right answers?" with the text ending at the words "could provoke such a question."

 2. A message with a blank subject the the "Correspondents" set to "Passages," containing the text starting at "Charles Babbage (...)" and continuing to the end of the file, including the closing MIME boundary.


Expected results:

The "Bug Demo" folder under "Local Folders" has a single message from Charles Babbage with the subject line "Wrong numbers, right answers?" with the complete text as seen between the MIME boundaries.