Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

The other day I came in to work and found that our development server - a Ubuntu box - had a full hard disk. I did a bit of investigation and it seems like mozilla thunderbird is the major culprit. After burning off some backup files which did not need to be on the machine, the disk was left at 94%:

$ df -h
Filesystem            Size Used Avail Use% Mounted on
/dev/sda1             895G  791G   59G  94% /
none                  4.0G  300K  4.0G   1% /dev
none                  4.0G  1.4M  4.0G   1% /dev/shm
none                  4.0G  140K  4.0G   1% /var/run
none                  4.0G     0  4.0G   0% /var/lock
none                  4.0G     0  4.0G   0% /lib/init/rw
$ cd
$ du -ch | grep [0-9]G
666G    ./.thunderbird/ccsmcruu.default/ImapMail/mail.adofms.com.au
666G    ./.thunderbird/ccsmcruu.default/ImapMail
667G    ./.thunderbird/ccsmcruu.default
667G    ./.thunderbird
2.2G    ./.VirtualBox/Machines/iBike/Snapshots
2.2G    ./.VirtualBox/Machines/iBike
2.2G    ./.VirtualBox/Machines
2.2G    ./.VirtualBox
670G    .
670G    total

I did some reading and found that Mozilla Thunderbird does not compact files by default - i.e. all of the old emails that were sent to trash are still kept. One of the mailboxes used to get a lot of spam so I guess this accounts for the 667GB. I opened up Thunderbird to see how much space the inbox actually takes up and it turns out to be approximately 500MB - over 1000 times less than the stuff that has not been compacted over the years.

So i right clicked on the inbox directory in the tree on the left of Thunderbird and selected 'compact'. I left it for about 12hours but even after that it still said 'compacting folder' on the status bar. I don't use Thunderbird on this PC - it belonged to a colleague who has left the company, however I do occasionally need to look through the inbox for references to the project I am working on, so deleting all traces of Thunderbird is not an option.

My question is - is there any way I can monitor the progress of Thunderbird's compacting function? I would really like to know how long it is going to take.

If there is any way I can speed up the compacting process i would also like to know.

share|improve this question
    
There should be a progress bar left to the "Unread:" label. I have no idea how long it's supposed to take to process 666 GB, though. –  htorque Mar 9 '11 at 8:44
    
really? there is no progress bar on my version of thunderbird - im using 3.0.10. do you know which version has a progress bar? if its a later one then maybe i can upgrade... –  mulllhausen Mar 9 '11 at 23:35

2 Answers 2

up vote 2 down vote accepted

i found a much quicker solution! just right click on the each inbox and select properties. then under the 'general information' tab select 'rebuild index'. this took about 30 seconds and cleaned the whole thing up!

$ df -h
Filesystem            Size Used Avail Use% Mounted on
/dev/sda1             895G  120G  730G  15% /
none                  4.0G  300K  4.0G   1% /dev
none                  4.0G  1.5M  4.0G   1% /dev/shm
none                  4.0G  140K  4.0G   1% /var/run
none                  4.0G     0  4.0G   0% /var/lock
none                  4.0G     0  4.0G   0% /lib/init/rw
$ du -ch | grep [0-9]G
2.2G    ./.VirtualBox/Machines/iBike/Snapshots
2.2G    ./.VirtualBox/Machines/iBike
2.2G    ./.VirtualBox/Machines
2.2G    ./.VirtualBox
4.3G    .
4.3G    total

far out! from 667GB to less than 1GB in 30 seconds!! that was quick! :)

share|improve this answer

Since you are using IMAP, the mail is stored on the server, and just cached locally. You can shut down thunderbird and go into that directory and just delete the giant file. You also might want to make sure that you have the checkbox to sync the folder locally for offline access cleared.

Given that the directory is SO large, it looks like there is a bug that somehow caused it to fill with garbage. Also moving messages to the trash has nothing to do with compacting a mailbox. The trash is just another folder, so if you want to really delete the mail, you have to empty the trash.

When using IAMP, compacting a folder just has thunderbird throw out the cached email. For local mailboxes ( used with POP ), compacting rewrites the mailbox, removing any unused space. Space normally becomes unused when you delete mail, and can be reused by new mail that fits within that space, but sometimes the spaces can be so small that they can't be reused, and if there are many of them, it adds up.

share|improve this answer
    
ah yeah. i see what you mean - the mail itself is safe since it is stored on the imap server. are you sure that deleting the mail.adofms.com.au file will not corrupt thunderbird though? i think i'll wait and see how many people agree with your suggestion. no offense but it could be a lot of hasstle if it goes wrong. –  mulllhausen Mar 9 '11 at 23:33
    
@mulllhausen inside the directory you will find a pair of files for each mailbox you have: mailbox and mailbox.msf. The msf stands for mail summary file and it will be regenerated if you delete it ( though this can take some time ). In the case of IMAP, you only have the mailbox file if you have enabled local storage for offline work, and this will also be refilled as new mail comes in, or you can download all of the mail again by clicking the download now button under synchronization of folder properties. –  psusi Mar 10 '11 at 0:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.