Mailinglist Archive: opensuse (1606 mails)

< Previous Next >
Re: [opensuse] in thunderbird, all my saved list mails not showing, but still in file [SOLVED]
  • From: "David C. Rankin" <drankinatty@xxxxxxxxxxxxxxxxxx>
  • Date: Wed, 03 Sep 2008 23:56:11 -0500
  • Message-id: <48BF6A6B.2060402@xxxxxxxxxxxxxxxxxx>
David C. Rankin wrote:
David C. Rankin wrote:

In thunderbird, I did something that made all my saved opensuse list messages disappear. I thought at first I had deleted them with a stray ctrl+shif+A followed by a shift+del, (accidentally done with 'caplocks' on) but apparently I didn't do that because all the messages are still in my "/home/david/.thunderbird/2k12pnl0.default/Mail/" file. Looking at the file in text it contains all the saved mails for approximately the past year, but only the messages for the last 2 days are visible from within thunderbird itself.

How do I tell tbird to reindex all the messages and give me the full folder back?? It seems like a simple reindex should do, but no dice. Anybody have any experience/suggestions on this one?


Looks like is will be the mother of all find-and-replaces or a sed script to parse the file and reset:

X-Mozilla-Status: xxxx

Now all I have to do is find a good reference on X-Mozilla-Status: flags.


It wasn't pretty, but you can, for the most part, recover all accidentally deleted files in a thunderbird mailbox. The key is the mail header line containing "X-Mozilla-Status: xxxx" where xxxx is a four hex-digit code for the messages status (new, read, forwarded, replied, deleted, etc...). I attempted to do this by script, but ran into limitations with the bash builtin "read" stripping leading whitespace from the mail header lines so I ended up doing a simple search and replace in vi using %s/X-Mozilla-Status: xxxx/X-Mozilla-Status: yyyy/ to update the values to undelete the messages.

To accomplish this, basically exit tbird. Locate your mailbox location. It will usually be stored under the directory structure similar to: ~/.thunderbird/[hash].default/Mail/[your account]/[mailboxname].

My openSuSE messages were stored in the following location: ~/.thunderbird/2k12pnl0.default/Mail/

Make a BACKUP COPY of your mailboxname. I just used mailboxname.sav. Then edit your mailbox in an editor that can handle search and replace and update the value of the X-Mozilla-Status: entries so that tbird will make them visible the next time you start tbird.

The basic scheme of the xxxx code is: x3 x2 x1 x0 (that is where x0 is the least significant x for lack of better words). Their "loose" definitions are as follows:


[ 0=new, 1=read, 2=replysent, 3=(1+2), 4=userset, other flags, 8=moved ,9=deleted(1+8), b=deleted(3+8) ]

Evidently, the thunderbird scheme is to add "8" to x0 to mark the message as deleted and not displayed.


[ 0=default, 1="subject has Re:", 2="children of subthread folded", 8="offline read for imap ]


[ 1="thread is watched", 2="sender was authenticated", 4="partial of multipart", 8="queued for delivery"


[ 0=default, 1="message has been forwarded" ]

So basically to recover your messages all you care about is "x0", but to preserve as much of your mail message statuses, you just don't want to set everything back to 0000. Here is the replacement scheme I used with vi search and replace:

:%s/X-Mozilla-Status: 1019/X-Mozilla-Status: 1011/
:%s/X-Mozilla-Status: 1009/X-Mozilla-Status: 1001/
:%s/X-Mozilla-Status: 001b/X-Mozilla-Status: 0013/
:%s/X-Mozilla-Status: 0019/X-Mozilla-Status: 0011/
:%s/X-Mozilla-Status: 000b/X-Mozilla-Status: 0003/
:%s/X-Mozilla-Status: 0009/X-Mozilla-Status: 0001/

The next time I started the mailer, all the messages reappeared.

As I mentioned earlier, I attempted to do this by script, but 'read' was stripping the leading spaces and I just wanted it done. I'll follow up with a separate post on that. However, for the curious, here is where I was headed:

{ while read XTAG VALUE LINE; do

if [[ ${XTAG} == "X-Mozilla-Status:" ]]; then
case ${VALUE} in
1019 ) NEWVAL=1011;;
1009 ) NEWVAL=1001;;
001b ) NEWVAL=0013;;
0019 ) NEWVAL=0011;;
000b ) NEWVAL=0003;;
0009 ) NEWVAL=0001;;
echo -e "${XTAG} ${NEWVAL} ${LINE}" >> ${NEWFILE}
echo -e "${XTAG} ${VALUE} ${LINE}" >> ${NEWFILE}


done } <

David C. Rankin, J.D., P.E.
Rankin Law Firm, PLLC
510 Ochiltree Street
Nacogdoches, Texas 75961
Telephone: (936) 715-9333
Facsimile: (936) 715-9339
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups