Are your Thunderbird attachments taking up too much space?
Thunderbird offers the ability to "detach" attachments from messages, so they don't increase the size of your profile folder. This is particularly useful when you're trying to get your profile folder down to a reasonable size, for say, backup purposes. Note that when you're all done, you'll need to compact your folders to actually recover the disk space (this goes for deleted files as well). You can do so by browsing to File -> Compact Folders.
Here's how to detach messages one at a time:
Detaching Thunderbird messages one at a time
- Open or select the email with the attachment
- Right-click the attachment and select "Detach..." (note: if you select "Save As..." it will merely save a copy of the message - it won't detach it and therefore won't reduce the size of your email message)
- You will be prompted with a save location for the attachment, after which you'll be prompted again confirming that you want to delete the attachment from the message
Note that once the attachment is deleted, you'll still see it - ie. the filename will remain, even though the attachment is no longer there. This is useful for keeping track of what attachments were attached to specific messages. The attachment icon, however, will be removed, so you'll know the attachment has been detached.
Is there a way to mass detach all Thunderbird message attachments?
If you have a massive Inbox (and other folders) full of messages with large attachments, detaching them one by one could take an eternity. Wouldn't it be nice to have an addon utility that lets you manage the detachment of Thunderbird messages for all your messages? Enter the Thunderbird Attachment Extractor.
How to mass detach all your Thunderbird attachments
First, browse on over and download and install the Thunderbird add-on, Attachment Extractor. Once you have it installed, we'll show you some general configuration settings and tweaks that we find useful.
Optimizing the Thunderbird Attachment Extractor settings for your needs
Once you have the Thunderbird Attachment Extractor successfully installed (you may need to restart Thunderbird), browse to Tools -> Attachment Extractor Settings, and note the following settings changes that might prove useful (we're skipping configuration changes that are self-explanatory and you can modify according to your liking):
- Under the General tab, you'll notice the second section entitled "After extracting the attachments should we:" See the screenshot for our settings preferences:
- We've chosen to delete the attachment from the message. Why? Because if we don't, we'll run into the problem that Attachment Extractor freezes when trying to find a detached file that is no longer in the original save location.
- We choose to use AE's internal routine. Please note that while it works okay for us, it is experimental, which means it's not advisable to use this on important files. AE advises that in some cases, file attachments may go missing or email messages end up blank. You may want to try it on some test messages first, or hold off until a more stable release is published. The reason we use this routine is because, if you use the normal Thunderbird code with a lot of attachments, Thunderbird will continually prompt you asking you to confirm that you wish to detach the file. As far as we're aware, there's no way to turn off this alert.
- Under the Advanced tab, the change we made was checking the box "also extract embedded (inline) images," as this will further reduce the size of your profile folder, and therefore make it easier to backup.
- Finally, under the Filenames tab, we add the following extensions to "Extract all files except where the filename contains (default files in italics): *.eml; *.bat; *.exe; *.ade; *.adp; *.bas; *.chm; *.cmd; *.com; *.cpl; *.crt; *.hlp; *.hta; *.inf; *.ins; *.isp; *.js; *jse; *.lnk
- For the filename pattern generation, we use the following pattern:
- Which results in a filename that we can sort by the sender of the email. We found this most practical for finding attachments later. An example filename using this pattern: email@example.com_2008-12-20_picture-1.jpg
- Note that in order to get the date in the Month - Day - Year pattern we clicked the edit date pattern button and entered the following: Y-m-d
- AE freezing Thunderbird? If editing these settings is causing weird behavior - ie. blank settings fields, an "OK" button that doesn't work anymore, and Thunderbird crashing, check out the troubleshooting section below.
AttachmentExtractor freezes while detaching a particular file (one of many)
It also appears that if you previously detached an attachment, potentially with an older version of Thunderbird, and that detachment is no longer available, AttachmentExtractor will not be able to detach the file, and will freeze if it's in the middle of detaching a string of multiple attachments. To be more specific, this appears to occur with messages where you still see the attachment plus icon, but when you click on the attachment, it tries to find the attachment based on the previous save location, but can't, and thus returns "file not found."
Solution - until a fix is released, the temporary solution to this problem is to close the extracting window (which by now has frozen), and then recreate an empty file with the same name as the one that was detached, and now cannot be found. Attachment Extractor will recognize the file name and resume processing the file.
AttachmentExtractor crashes Thunderbird when you try and save settings changes
This appears to be a common error when you try and edit settings on the Advanced page. The way around this is to edit the settings directly in Thunderbird's config editor. For example, to directly edit the filename pattern generation, you would browse to (in Thunderbird) Tools -> Options -> Advanced tab -> Config Editor.
This will bring up the config editor window, which may appear daunting at first sight. To make this simple, type the word attachmentextractor to filter out all the settings related to Attachment Extractor. You'll see the following screen:
The setting that reflect those we just set above are:
- 0 = Delete with normal Thunderbird code
- 1 = Delete with AE's internal routine
- 2 = Detach with AE's internal routine
- The string here will reflect the file extensions to filter (ie. *.eml;*.bat;...)
After playing around with the config editor for a while you'll notice other settings from the user interface.
Solution - the solution to AE causing Thunderbird to freeze is to use the config editor to manually enter the settings, in particular the filename exclude patterns. You'll notice that even though the user interface may appear empty (prior to crashing Thunderbird), the settings are saved in the config editor, which is what counts.
This way, you should be able to continue using Attachment Extractor until these bugs are fixed in the next release. Note that at the time of this writing we were unable to find a viable alternative to Attachment Extractor. If you find one, please post below.
Compact your folders to recover disk space
Once you've finished detaching and deleting your attachments, there's one more final and important step you need to take to actually recover your disk space (ie. reduce the size of your Thunderbird profile folder). You need to compact your folders. To do so, simply:
- Browse to File -> Compact Folders
Thunderbird will do the rest. This may take a while, especially if you've never compacted your folders before. Compacting your folders will recover disk space not only from attachments you've removed, but also from any messages you've deleted, including those you deleted from your trash bin. If you are compacting for the first time, get ready to save a huge amount of disk space