Bug: Deleting Attachments Corrupts MIME Boundaries
Status: RESOLVED
Priority: --
Resolution: WORKSFORME
Created: 2021-01-05 23:00:59+00:00
Resolved: 2021-12-07 08:37:37+00:00

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.2 Safari/605.1.15

Steps to reproduce:

Deleted jpeg attachment from email message then deleted email message.


Actual results:


macOS Big Sur 11.1
Thunderbird  78.6.0 (64 bit) IMAP Protocol

I sent myself an email with a picture attached from my cell phone we'll call this email SENT-1. The sent message was placed in my Sent folder on my email server.

Using Thunderbird I saved the picture sent in email SENT-1 to my desktop we'll call this PICTURE-1.

I then sent a a message to Recipient-8 with text and PICTURE-1 attached to it, we'll call this SENT-2.

Using Thunderbird I went into my Sent folder and pulled up email SENT-1 and deleted the PICTURE-1 that was attached to it. When the deletion of the attached PICTURE-1 in SENT-1 was completed I deleted email SENT-1 from the Sent folder.

When I deleted email SENT-1 from the Sent folder email SENT-2 was also deleted from the Sent folder, or that's how it appeared because email SENT-2 disappeared from the Sent folder. I did *not* want email SENT-2 to be deleted, it was *not* selected when I deleted email SENT-1.

Fearing the loss of email SENT-2 I immediately went to my email server and made a copy of my Sent folder file. Trying various things in Thunderbird to get the SENT-2 email to show up in the Sent folder, Get Messages, change to different fold then back to Sent, quitting restarting Tbird, etc. nothing worked.

I quit Tbird and then went to my email server and using vi took a look at my Sent file. The SENT-2 email was still in the file but the MIME boundaries were all screwed up. The SENT-2 email had 2 unique MIME hexadecimal boundaries in it, I assume it's originally correct hex boundary *and* the hex boundary from the deleted SENT-1 email.

Here's what the boundaries looked like in the Sent file for the last 9 emails:

From <Me> Mon Dec 28 14:35:00 2020 -0600
To: Recipient-1
Content-Type: multipart/mixed;
 boundary="------------B7C3C79499465B366BB56599"
--------------B7C3C79499465B366BB56599
Content-Type: text/plain; charset=utf-8; format=flowed
--------------B7C3C79499465B366BB56599
Content-Type: image/png; x-mac-type="0"; x-mac-creator="0";
--------------B7C3C79499465B366BB56599--

From <Me> Mon Dec 28 16:29:00 2020 -0600
To: Recipient-2
Content-Type: multipart/alternative;
 boundary="------------35AF82EB40E16303CA0D9549"
--------------35AF82EB40E16303CA0D9549
Content-Type: text/plain; charset=utf-8; format=flowed
--------------35AF82EB40E16303CA0D9549
Content-Type: text/html; charset=utf-8
--------------35AF82EB40E16303CA0D9549--

From <Me> Mon Dec 28 16:58:00 2020 -0600
To: Recipient-3
Content-Type: multipart/alternative;
 boundary="------------8ED83EBF830D9004D907B188"
--------------8ED83EBF830D9004D907B188
Content-Type: text/plain; charset=utf-8; format=flowed
--------------8ED83EBF830D9004D907B188
Content-Type: text/html; charset=utf-8
--------------8ED83EBF830D9004D907B188--

From <Me> Mon Dec 28 17:46:00 2020 -0600
To: Recipient-4
Content-Type: multipart/alternative;
 boundary="------------81E06EB40031CB6D1952E494"
--------------81E06EB40031CB6D1952E494
Content-Type: text/plain; charset=utf-8; format=flowed
--------------81E06EB40031CB6D1952E494
Content-Type: text/html; charset=utf-8
--------------81E06EB40031CB6D1952E494--

From <Me> Tue Dec 29 07:26:00 2020 -0600
To: Recipient-4
Content-Type: multipart/alternative;
 boundary="------------B584AEF8353679363D6D28D8"
--------------B584AEF8353679363D6D28D8
Content-Type: text/plain; charset=utf-8; format=flowed
--------------B584AEF8353679363D6D28D8
Content-Type: text/html; charset=utf-8
--------------B584AEF8353679363D6D28D8--

From <Me> Tue Dec 29 14:44:00 2020 -0600
To: Recipient-5
Content-Type: multipart/alternative;
 boundary="------------2D2601545BD6B7676465022E"
--------------2D2601545BD6B7676465022E
Content-Type: text/plain; charset=utf-8; format=flowed
--------------2D2601545BD6B7676465022E
Content-Type: text/html; charset=utf-8
--------------2D2601545BD6B7676465022E--

From <Me> Fri Jan  1 14:06:00 2021 -0600
To: Recipient-6
Content-Type: multipart/alternative;
 boundary="------------9C9F860057DC9076403FBDFB"
--------------9C9F860057DC9076403FBDFB
Content-Type: text/plain; charset=utf-8; format=flowed
--------------9C9F860057DC9076403FBDFB
Content-Type: text/html; charset=utf-8
--------------9C9F860057DC9076403FBDFB--

From <Me> Mon Jan  4 11:23:00 2021 -0600
To: Recipient-7
Content-Type: multipart/mixed;
 boundary="------------BF848146AC3925BBB5D8E660"
--------------BF848146AC3925BBB5D8E660
Content-Type: text/plain; charset=utf-8; format=flowed
--------------BF848146AC3925BBB5D8E660
Content-Type: image/png; x-mac-type="0"; x-mac-creator="0";
--------------BF848146AC3925BBB5D8E660
Content-Type: image/png; x-mac-type="0"; x-mac-creator="0";
--------------BF848146AC3925BBB5D8E660--

From <Me> Tue Jan  5 14:23:00 2021 -0600
To: Recipient-8
Content-Type: multipart/mixed;
 boundary="------------079368E0EA0E2E6875D94560"
--------------079368E0EA0E2E6875D94560
Content-Type: multipart/alternative;
 boundary="------------20ED279648E2E69ED2D2A05A"
--------------20ED279648E2E69ED2D2A05A
Content-Type: text/plain; charset=utf-8; format=flowed
--------------20ED279648E2E69ED2D2A05A
Content-Type: text/html; charset=utf-8
--------------20ED279648E2E69ED2D2A05A--
--------------079368E0EA0E2E6875D94560
Content-Type: image/jpeg; x-mac-type="0"; x-mac-creator="0";
--------------079368E0EA0E2E6875D94560--


The MIME boundaries are correct for the first 8 emails in this list, the 9th email to Recipient-8 is the SENT-2 email and you can see the MIME boundaries are all screwed up.

Took me a couple hours to figure out this is what the problem was and then to fix it. This is what the MIME boundaries in the SENT-2 email to Recipient-8 should have been and what I changed them to:

From <Me> Tue Jan  5 14:23:00 2021 -0600
To: Recipient-8
Content-Type: multipart/mixed;
 boundary="------------20ED279648E2E69ED2D2A05A"
--------------20ED279648E2E69ED2D2A05A
Content-Type: text/plain; charset=utf-8; format=flowed
--------------20ED279648E2E69ED2D2A05A
Content-Type: text/html; charset=utf-8
--------------20ED279648E2E69ED2D2A05A
Content-Type: image/jpeg; x-mac-type="0"; x-mac-creator="0";
--------------20ED279648E2E69ED2D2A05A--

Thunderbird corrupting MIME boundaries like this is unacceptable.

I did not try to reproduce this and I am not going to try and reproduce this. That email to Recipient-8 was a business related email so I needed my copy which Thunderbird corrupted to the point where it itself could not even display it to me until I manually fixed the MIME boundaries...



Expected results:

Thunderbird should not corrupt MIME boundaries when deleteing attachments and/or eamils.