Thunderbird - how to avoid 'compact folders' losing messages?

Discussion in 'Firefox' started by Alex Hunsley, Aug 31, 2006.

  1. Alex Hunsley

    Alex Hunsley Guest

    According to the Wikipedia page on Thunderbird

    "Compacting folders can lead to the loss of messages in the folder you
    are viewing at the time"

    Is this true? If so, how can I avoid this behaviour? Select an account
    itself (rather than 'inbox', for example) before doing 'compact folders'?
    I find it disturbing that a wikipedia page will mention something
    alarming like this and not have a workaround or link to further details!

    Alex Hunsley, Aug 31, 2006
    1. Advertisements

  2. Alex Hunsley

    Alex Hunsley Guest

    Ok, this link is of some usefulness...
    It doesn't seem to mention how to avoid 'losing messages' though!
    Alex Hunsley, Aug 31, 2006
    1. Advertisements

  3. I've never had a problem of losing messages in the folder if I compacted
    it will in view... and to be honest, I dont recall anyone else having
    the problem either.

    I vagually remember something like that many moons ago, when
    Thunderbird first came out - but not since. The author of the wikipedia
    article doesnt state where that information arises from.

    I wouldnt worry about it.
    Mozilla Champion (Dan), Aug 31, 2006
  4. Alex Hunsley

    Alex Hunsley Guest

    Ok, thanks!
    Alex Hunsley, Aug 31, 2006
  5. Alex Hunsley

    Andy Luddy Guest

    Combining the Wikipedia article with the Mozillazine article, I would
    hazard a guess that problem occurs when you are compacting folders at
    the same time as you get mail that should write to that folder. If
    that's the case, a safeguard would be to turn off "Automatically
    download new messages".
    Andy Luddy, Aug 31, 2006

  6. Presuming or hazarding a guess isnt going to cut it. My Thunderbird
    routinely offers to compress my folders as the mail is coming in, while
    I am viewing my main account.

    Again, this has never happened to me, nor have I heard of it happening
    to anyone else in the last 2 and a half years. While it may have
    occurred to the author of the wikipedia page, or he may have heard about
    it, the problem, whatever it was seems to have been fixed long ago
    Mozilla Champion (Dan), Aug 31, 2006
  7. Alex Hunsley


    Aug 16, 2012
    Likes Received:
    Attention: Mozilla Champion (Dan);

    I'm not sure if you work for Mozilla or not and I'm not sure that your information is correct.

    >> I've never had a problem of losing messages in the folder if I
    >> compacted it will in view... and to be honest, I dont recall anyone
    >> else having the problem either.

    I just compacted on of my inbox folders in SeaMonkey this morning and lost all the emails that were in that inbox. Therefore, from my experience, I do not recommend to anyone to compact their folders as there is not enough information out there to know whether or not you can loose email messages and how that occurs. Shame on Mozilla for encouraging such a practice without providing sufficient guidance for their users.

    I would hazard a guess that this problem has NOT been fixed!
    rsoly, Aug 16, 2012
  8. Alex Hunsley


    Aug 27, 2012
    Likes Received:
    I agree with rsoly, 2 weeks ago ALL emails in inbox vanished. Archivies survived but I lost some important mail. Strange things happening today and then Thunderbird locked up....never, ever had that happen. Long, long time Thunderbird user and NEVER a clitch. What to do? Any recovery of lost mail? All this has to do with file compacting. It never happened until Thunderbird just started asking or doing the compacting. Outlook, OMG NO! But....can't live this way.
    jham, Aug 27, 2012
  9. Alex Hunsley


    Oct 15, 2014
    Likes Received:
    I would like to report confirmed loss of messages from my imap inbox. I message received today disappeared from the inbox after compression. I opened outlook client to the same mailbox, and the lost message was there. After I restarted Thunderbird, it disappeard from there too. Several messages were affected (my gut feeling) but this particular one I am absolutely certain. The lost message cannot be found from the Trash or Deleted Items either. As far as I can see, it has disappeared without a trace! This is a serious problem that has happened to me few times over the last few years (gut feeling) but this is the first time that I was able to confirm the loss (by seeing the mail still in Outlook inbox while I was not able to locate it anywhere in Thunderbird).

    I have not found any explanation or solution to this. Any help?

    Otto, Kuopio, Finland
    Otto, Oct 15, 2014
  10. Alex Hunsley


    Nov 13, 2014
    Likes Received:
    "Compacting" a folder has nothing to do with compressing or zipping a file. Compressing/zipping only changes how data is stored; compacting changes the actual data. Compacting a folder frees wasted space but the main reason to do it regularly is because it's a type of preventative maintenance. If you don't compact your folders regularly, performance can slow to a crawl, you can't store new messages anymore, start losing parts of messages or have deleted messages resurrected. If you notice a message has a date of 1969 that is due to it losing the Date: header in the message.

    Corrupt folders tend to occur when you have lots of messages in a folder, many of them are deleted, and you don't compact often enough.
    More info here;

    Background info - understanding what is going on:
    All emails stored in Thunderbird, are stored in mbox files - not folders. The emails are written to the file one after the other in the order they were downloaded. They are not stored as individual .eml files. The Inbox folder you see in your Folder Pane is actually a file. It is not a good idea to allow files to get large.

    So maintain your Thunderbird mail account:
    • Keep the Inbox low in email numbers.
    • Create new folders to organise emails.
    • Archive older emails by month and year and select to keep folder structure - including the Sent folder. - This will help to keep the file sizes smaller.
    • Compact folders on a regular basis, especially the Inbox as it sees more activity than other files,
    When you delete a message, it is 'marked as deleted' and from your point of view the message disappears from eg; Inbox and goes to Trash. In reality, it is still in the Inbox hidden from view. This means that should you need to recover the email because you deleted by accident, the email can have the 'marked as deleted' info changed and the email reappears. So, the unwanted 'marked as deleted' email is taking up space in the mbox file. Compacting (not compressing) removes that 'marked as deleted' section in the file and frees up space.

    If you do not do basic maintainance and compact frequently, corruption might occur wthin the file as described in the top section. It may not be possible to tell where a 'marked as deleted' mail ends and so could result in losing adjacent emails.

    If you start to get symptoms of a corrupt folder such as deleted emails being resurrected (not redownloaded), the best way forward would be to move all good emails out of that folder, delete unwanted emails and then right click on folder and select compact.

    Unfortunately, it is not always easy to notice if a folder in the Folder Pane has become corrupted. Following good basic organising and maintenance can avoid such occurances. It is also a good idea to periodically create backups of your Thunderbird Profile.

    If you have a pop mail account, I would suggest you keep a months worth of emails on the server and backup once a month. Between the two you should be able to recover emails if required.
    If you have an IMAP mail account, synchronise subscribed folders to get a copy in an mbox file in Thunderbird. Then go into 'Offline' mode to stop further synchronising and create a backup of the Profile.

    If you use auto compacting set the level quite low to encourage more frequent compacting. You can also manually compact regardless of whether auto compacting is set or not.

    If using IMAP and prompted to compact, I would suggest you stop viewing emails, stop synchronising / downloading; go into offline mode and allow compacting. It only takes a few seconds. Then whilst in offline mode you would be able to see if emails had disappeared due to compacting. If they had disappeared, then do not synch with server otherwise the server would get updated. Instead, with Thunderbird closed, access Profile name\IMapMail\mail account and delete the eg: Inbox file and Inbox.msf file. then when you restart Thunderbird in online mode, it should see there is no folder and recreate the Folder coping everything that was on the server.

    IMAP mail accounts offer a remote view of the folders on the server. If you delete an email regardless of whether it was deleted via webmail, Thunderbird or any other email client accessing those folders using IMAP, it will be deleted off the server and so deleted from all other IMAP mail accounts connecting to same account on server. This is normal.

    Additional helpful links:

    re :I opened outlook client to the same mailbox, and the lost message was there.
    Therefore having located a good copy in Outlook, the best way to recover that email and get it back on the server would be to immediately go offline without synchronising to stop Outlook synchronising with a server Inbox that does not have that email and then copied/moved that email into Local Folders, so that it is no longer associated with the imap mail account.
    Then after restarting all email clients, it would only be in the Local Folder, so then you could put it back on the server and it would reappear in all email clients when they synchronised with server.
    Last edited: Nov 13, 2014
    Toad-Hall, Nov 13, 2014
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.