Buy now
Tech support
D.S. Visualizer (free)

Home / Tools / Zmeil / Deleted messages in Thunderbird

Handling deleted messages in Thunderbird

How Thunderbird handles deleted messages

When you delete messages from your mail folder in the Thunderbird program, those messages won't be actually removed from the corresponding database file, unless you compact it. Instead, Thunderbird merely changes the status of those messages in the original email database file.

Status of a message is described by two service tags (fields)  X-Mozilla-Status and X-Mozilla-Status2. When Thunderbird needs to mark a message as deleted, it changes the value of these fields without actually removing the message from a database file. Hence, the easy way to restore a deleted message is just to correct the status fields of the message so that Thunderbird takes it for a new one the next time you start Thunderbird.

Some values of the status fields are given below. The values must be exactly four or eight characters.


  • 0001 - Message has been read.
  • 0002 - A reply to this message has been sent.
  • 0004 - User has marked (starred) this message.
  • 0006 - 0002 + 0004 combined.
  • 0007 - 0001 + 0002 + 0004 combined.
  • 0008 - Messages with this bit set will be irreversibly removed from a database file during the next compaction.
  • 0009 - 0008 + 0001 (read, deleted message).


  • 00010000 - This message is new since the last time the folder was closed.
  • 00200000 - If set, this message is marked as deleted on the server. This only applies to messages on IMAP servers.
  • 00040000 - If the bit set, this thread is ignored (In fact, a message with this bit set is not displayed).
  • 10000000 - Indicates that the message has an attachment.

For more information on values of Mozilla status fields please refer to http://lxr.mozilla.org/seamonkey/source/mailnews/base/public/nsMsgMessageFlags.h#108

How to restore a deleted message from Thunderbird email database file

Thus, when you need to restore a deleted message:
  1. Close the Thunderbird program and backup the original email database file you want to edit. (How to locate Thunderbird email database file in Windows?)
  2. Open Thunderbird email database file in your favorite text editor using the Edit mode (Text editors considerations)
  3. Navigate to the desired message using the Search function of the text editor
  4. Determine the boundaries of the message. Each message within email database file starts with "From - " line which also has time and date (something like "From - Tue Oct 09 17:27:46 2007"). Hence, look slightly above and below the fragment of the message (to which you moved on the previous step) and find such starting lines. Your message will start at the upper line and end on the lower line.
  5. Check message fields from top to bottom of the message searching for "X-Mozilla-Status" and "X-Mozilla-Status2" lines.
  6. Change value of these fields to:
  • X-Mozilla-Status:xxxx  to X-Mozilla-Status:0000 (doing so you mark the message as new and unread)
  • X-Mozilla-Status2:xxxxxxxx to X-Mozilla-Status2:00000000 (this ensures that the message is not a deleted one).
  1. Save changes to the email database file
  2. Delete the corresponding MSF file (What is a .MSF file?)
  3. Start Thunderbird

How Zmeil handles messages deleted from Thunderbird

  • Previous versions of Zmeil email recovery software extract email messages from Thunderbird database file in such a form as they were without any editing. Therefore, if a message has been marked as deleted in the database file, the recovered form of this message will have the same status, and such a message won't be displayed in Thunderbird.
  • This problem is corrected starting with Zmeil 2.1 by removing the status fields from the recovered form of the messages. Thus, all the extracted email messages will be displayed in Thunderbird as new and unread.

<<System configuration tipsZmeilThunderbird recovery with Zmeil>>

Copyright © 2001 - 2013 ZAR data recovery.