MozillaZine

recover email deleted by "message aging"?

User Help for Mozilla Thunderbird
(Anonymous/guest posting allowed)
qxmqxm
 
Posts: 4
Joined: June 14th, 2006, 4:22 pm
June 14th, 2006, 4:29 pm

Post Posted June 14th, 2006, 4:29 pm

I was trying to slim down my news accounts in Thunderbird version 1.5.0.4 (20060530), running on mac OSX 10.4.6. I set the news accounts to delete all messages older than 10 days. I didn't realize it would also delete ALL *emails* older than 10 days, from the inbox, the sent mail folder, all other saved folders. The page here on mail aging (http://kb.mozillazine.org/Message_aging) suggests the deletion is permanent. How permanent is permanent? Does annyone know how I might recover these emails? The overall disk usage did not change, despite the total email volume in question being several gigs, which suggests the stuff is there somewhere. I am a recent switcher from XP and not really sure how to truly dig in the file system for something like this. Thanks in advance for any advice!

Daifne
Moderator

User avatar
 
Posts: 114519
Joined: July 31st, 2005, 9:17 pm
Location: Where the Waters Meet, Wisconsin
June 14th, 2006, 4:44 pm

Post Posted June 14th, 2006, 4:44 pm

How did you set the aging? Did you use Retention in each folder's properties or...?

There may be a way to recover them, but I need to know exactly what you did first. Also, for now. Do NOT compact your folders.
Join the MZ folding@home team.
"A lie can run round the world before the truth has got its boots on." - Sir Terry Pratchett
Please do not PM me for personal support. Keep posts here in the Forums instead and we all learn.

qxmqxm
 
Posts: 4
Joined: June 14th, 2006, 4:22 pm
June 14th, 2006, 4:48 pm

Post Posted June 14th, 2006, 4:48 pm

I went into Tools -->Account Settings ---> Offline & Disk Space ------> Delete messages more than x days old.

I selected 10 days. I was wanting to do this for the news reader subscriptions only but I must have indicated I wanted it for all local folders or something. That is, I probably went into ----> local folders and did the same thing trying to figure it out, but not realizing maybe how high the stakes were! Thanks.

Daifne
Moderator

User avatar
 
Posts: 114519
Joined: July 31st, 2005, 9:17 pm
Location: Where the Waters Meet, Wisconsin
June 14th, 2006, 4:54 pm

Post Posted June 14th, 2006, 4:54 pm

Ah. First, look at all your accounts under the account settings again and make sure you have undone the setting.

I don't know if this will work for this or not. It depends on whether that setting just deletes or if it deletes and compacts. If it's the second, I'm afraid they are gone.

(Thanks to Mr. Liu for this) There might be if you are lucky (and haven't compacted your folders yet or emptied the trash by right click>empty trash):

- Turn off Thunderbird, do not compact.
- Using your OS, locate the file without an extension and with the same name as the Thunderbird folder where the messages were last (might be Trash) in your profile folder http://kb.mozillazine.org/Profile_folder#Thunderbird
For example, the Inbox file rather than inbox.msf or inbox.sbd.
- Open this file with a simple text editor.
- Change the digits after X-Mozilla-Status all to zero for those messages you wish to undelete if they still exist.
- Save the file
- Turn off the text editor
- Delete the file of the same name with the extension .msf. Example Trash.msf
- If you are religious, say a prayer to the deity or saint of your choice
- Say a prayer to Murphy
- Restart Thunderbird
Join the MZ folding@home team.
"A lie can run round the world before the truth has got its boots on." - Sir Terry Pratchett
Please do not PM me for personal support. Keep posts here in the Forums instead and we all learn.

qxmqxm
 
Posts: 4
Joined: June 14th, 2006, 4:22 pm
June 14th, 2006, 4:56 pm

Post Posted June 14th, 2006, 4:56 pm

ok will try that. I have to go offline now for a couple of hours, will get back to you. Thanks a million. Fingers crossed!

Daifne
Moderator

User avatar
 
Posts: 114519
Joined: July 31st, 2005, 9:17 pm
Location: Where the Waters Meet, Wisconsin
June 14th, 2006, 4:58 pm

Post Posted June 14th, 2006, 4:58 pm

Fingers and toes crossed. ;-)
Join the MZ folding@home team.
"A lie can run round the world before the truth has got its boots on." - Sir Terry Pratchett
Please do not PM me for personal support. Keep posts here in the Forums instead and we all learn.

qxmqxm
 
Posts: 4
Joined: June 14th, 2006, 4:22 pm
June 15th, 2006, 12:23 am

Post Posted June 15th, 2006, 12:23 am

Woohoo. Good news, mostly.
Going into the text files and replacing X-Mozilla-Status: $$$$ with X-Mozilla-Status: 0000 will get Tbird to bring those emails back into their folders. It appears that it does not compact or delete the emails, it just changes the value for those more than 10 days old (or whatever) and highgrades the recent ones to display in the mailbox. So thats the good news!

Now, the secondary problem. Some of the folders are pretty big - 300 to 600 megs (I get a lot of attachments). These include the most critical folders: inbox, sent mail and my archive folder.

When I open these in TextEdit, they freeze up when I try to do replace. Word won't open larger than 32 megs (My powerbook has 1.5 gigs of ram)

So a follow up:
(a) is there a robust text editor good with very large files and search/replace
(b) can I edit these files without opening them via some sort of script?

The trick here is that X-Mozilla-Status: xxxx gets reset to a limited number of values, e.g.
X-Mozilla-Status: 0009
X-Mozilla-Status: 1009
X-Mozilla-Status: 001b
X-Mozilla-Status: 0011
X-Mozilla-Status: 0009

presumably these mean different things (read, not read, etc?), but it means you have to search and replace one each individually. So a text editor or a script that could accept wilcards, eg., replace X-Mozilla-Status: ???? with X-Mozilla-Status: 0000 would be ideal.

Any ideas on this?

Thanks a million for your help so far. I can't believe I've got as much back as I have!

Daifne
Moderator

User avatar
 
Posts: 114519
Joined: July 31st, 2005, 9:17 pm
Location: Where the Waters Meet, Wisconsin
June 15th, 2006, 8:02 am

Post Posted June 15th, 2006, 8:02 am

That is wonderful! Glad to know that this settings doesn't compact. Thank you.
You are very welcome.

Unfortunately, I don't know any alternatives for the Mac. I use TextPad, but it's Windows only. Maybe try some Google searches.
Join the MZ folding@home team.
"A lie can run round the world before the truth has got its boots on." - Sir Terry Pratchett
Please do not PM me for personal support. Keep posts here in the Forums instead and we all learn.

charleswj
 
Posts: 1
Joined: June 15th, 2006, 10:47 pm
June 15th, 2006, 10:53 pm

Post Posted June 15th, 2006, 10:53 pm

I assume OSX has sed, right? Try something like this:

sed 's/^X-Mozilla-Status: 0009$/X-Mozilla-Status: 0000/' <orig.mbx >new.mbx

where orig.mbx is the path to Inbox, Sent, etc. and new.mbx is the new mbox file. It will replace the 0009's with 0000's. Then, just replace orig.mbx with new.mbx and restart Thunderbird.

96is
 
Posts: 3
Joined: September 17th, 2007, 3:41 pm
March 20th, 2008, 8:31 pm

Post Posted March 20th, 2008, 8:31 pm

I recently permanently deleted my inbox and after finding qxmqxm's post about the values and having a 400+ MB file to go through I wrote this java program which will read through the the inbox file and set all of the emails to unread. If you follow the rest of the directions listed on this site ie:
- Stop Thunderbird !! Don't compact the folder
- Copy the FILE (Inbox, Trash, whatever) to another location
- run this java program on the copied file
- Copy the new FILE.out to the correct Thunderbird directory,
- Delete the file of the same name with the extension .msf. Example Trash.msf
- Rename the FILE.out to FILE
- Restart Thunderbird

This code resets <b>all</b> of the emails to new and unread, so if you haven't compacted the folder in 2 years :) You will have 2 years of emails to go through. This worked for me, YMMV

Total time:
To edit the file: ~ 5 minutes
To go through 2 years of emails ~ 2 hours
Erasing my mistake ~ priceless

If this matters I am running Ubuntu Gutsy, with Thunderbird version: version 2.0.0.12 (20080227) and Java 1.6

/**
* FileReader.java
* @author jnickell
*
* This program is designed to read in a file and find the specified expression and replace it
* with the desired expression
* Give the program the name of the file as a command line argument
* i.e. java fileReader Inbox
* No Guarantees
*/
import java.io.*;

public class fileReader
{
public static void main(String args[])
{
String FILE = args[0]; // File operated on is specified as a command line argument
BufferedReader read = null;
PrintWriter write = null;
String line = "";

try
{
read = new BufferedReader(new FileReader(FILE));
write = new PrintWriter(new FileOutputStream(FILE + ".out"));

while (line!=null)
{
line = read.readLine();
if (line.startsWith("X-Mozilla-Status:" ))
{
line = "X-Mozilla-Status: 0000";
}
write.println(line);
}

}
catch (Exception e)
{
System.out.println(e.getMessage());
}
finally
{
if (write != null)
write.close();
}
System.out.println("Done!");
}
}

Sherma
Guest
 
October 5th, 2008, 11:46 am

Post Posted October 5th, 2008, 11:46 am

My whole thunderbird account got whipped out, the file folder for my previous accounts are still on my mac. Is there a way that once i re-add my email accounts that i can get all my e-mails back into my various inboxes? I need help pleaseeeeee!!

SK
Moderator

User avatar
 
Posts: 20715
Joined: October 18th, 2007, 1:28 pm
Location: Third Rock From The Sun
October 5th, 2008, 11:53 am

Post Posted October 5th, 2008, 11:53 am

Sherma: Please start a new topic thread instead of hijacking an old thread. We can help you.
John 3:16 and Philippians 4:13

Return to Thunderbird Support


Who is online

Users browsing this forum: David4321 and 6 guests