Software

Keep Thunderbird from building too big a nest on your hard disk

Mozilla's Thunderbird is a great cross-platform alternative for reading e-mail. I've found that the software can require some tuning to provide the best possible experience, though. Here's a tip to keep your Thunderbird install speedy and healthy: compact your mailboxes.

Mozilla's Thunderbird is a great cross-platform alternative for reading e-mail. I've found that the software can require some tuning to provide the best possible experience, though. Here's a tip to keep your Thunderbird install speedy and healthy: compact your mailboxes.

-------------------------------------------------------------------------------------------------------------------

I've mentioned before my love for Thunderbird. Through its support for the POP3 and IMAP4 protocols, the program is compatible with nearly any messaging system, and its cross-platform nature makes it ideal for mixed-client environments. Like any love affair, though, ours has not been without its complications. I discovered that Thunderbird's Profiles directory could get really large, even when it seemed that it wasn't storing that many messages. After some investigation, I've found that the developers have built in a facility for keeping the program's disk consumption under control, and that's the "Compact Folders" command.

The manual "Compact Mailboxes" command can be found under the "File" menu, but the most efficient way to accomplish regular cleaning is by having Thunderbird compact its mailboxes automatically. Follow the menu path appropriate for your platform, and check the appropriate box in the program's settings...
  • Windows: Tools → Options → Advanced → Network & Disk Space → Disk Space → check "Compact folder when it will save over 100 KB" → click "OK."
  • Mac: Thunderbird → Preferences → Advanced → Network & Disk Space → Disk Space → check "Compact folder when it will save over 100 KB" → click "OK."
  • Linux: Edit → Preferences → Advanced → Network & Disk Space → Disk Space → check "Compact folder when it will save over 100 KB" → click "OK."

The fault comes from the message storage scheme that Thunderbird uses locally, the venerable mbox format. Mail messages are stored in a single text file for each mailbox. Deleted messages are flagged so they aren't displayed anymore in the mailbox view, but they aren't really removed from the mbox file until that file is compacted. The more messages you've read with Thunderbird, the larger your mbox files are. Every time you make a change to a mailbox -- deleting a message or moving it to another mailbox, for example -- your mbox files need to be rewritten. It's this process of rewriting large mbox files that can, over time, make Thunderbird seem laggy during mailbox operations. Making sure that your mbox files are compacted regularly will provide a better mail-reading experience for you and your users.

For more tips like this, you can check out the Thunderbird knowledge base at mozillaZine.

5 comments
rickst29
rickst29

Tbird-2 still sometimes "breaks", in an unpredictable way, on gigantic mailboxes containing thousands of messages. No one knows exactly how or why. *BUT*, people who 'compress' all of their folders on a frequent basis have never reported this problem. On every "lost my emails" bugzilla report, MScott would always ask, "Have you compressed your folders recently"? The answer has NEVER been "yes". You can install an extension, "xpunge", which allows you to compress all of your folders with a icon single click on your toolbar. I encourage all my customers to click on this EVERY TIME they're about to shut Thunderbird down. We've never had a messed up folder, not ever, in hundreds of user-years. So I think it's a very smart extension to use.

roger
roger

Thanks for the explanation. But, frankly, I think that this method of storing local data is stupid. There are perfectly good database programs that could be used for this purpose which would provide better data safety and much better performance. Think of SQLite for example, or the Embedded Firebird Server. Oh, well, hopefully one day.

williamjones
williamjones

There aren't many programs that IT pros spend more time in than their mail readers. In my most recent post, I describe a tweak that I made to the default settings in my mail client that smoothed out my experience considerably. What are some e-mail tips that you can share with the community?

rickst29
rickst29

I'll SWAG that sqlite would be just as bad (maybe worse, maybe just a bit better) as the current design. We've already seen a few "lost my bookmarks!" incidents with the Firefox 3 'places' database-- sqlite is extremely sensitive to metadata versus DB content conflicts. People who store their profiles on "remote" servers are especially prone to having a problem, because the sqlite code can't really tell how long to wait to ASSURE that the data has truly been written to oxide. (You can't even do this on your local machine, but window of opportunity for a "write confirmed, but the data didn't REALLY get there" problem is orders of smaller.) That's why Firefox 3 was modified (in May, between Beta-5 and Final) to save a "bookmarkbackups" every single day. The sqlite database is just not completely reliable (in the real world) when it's being written to on a frequent basis. And Firefox does this-- bookmarks and history are BOTH stored in "places.sqlite", and the history is updated every time to update a page or tab. When sqlite runs into trashed metadata, the whole DB is pretty much unrecoverable. There's no "defect" in the sqlite code, but the assumptions in the design aren't safe. Maybe Firebird can do a pretty solid "rebuild" when faced with such a conflict-- if so, it would be a viable choice. I won't even go into into the "wait for disk confirmation" problem with ext3 filesystems....

libskrap
libskrap

I have tried to find data on the max size of the db in thunderbird. no luck. does anyone know? is it same as outlook (16gb)? is it based upon number of emails or size of emails (incl attachments, the way outlook is)? or maybe it is individual folder size?

Editor's Picks