Restore Images on your Digital Camera Card

Uh oh - you just took a bucketful of honeymoon photos and towards the end of the trip your friend borrows the camera and accidentally formats the memory card.  Ahhhhh!!!  Don't freak out yet. Check out Disk Doctor and get $5 off as a CWD visitor. It just may save the day.

Constant Contact E-Newsletter Service - get 60 days free!

Constant Contact has been in business since 1996 is one of the most reliable and trusted email marketing services around. Click here to activate your free 60 day trial courtesy of CWD Community.



Dec 19 2008

Thunderbird - Mass Remove Attachments


Filed under: Software » Email,
Tools:

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:

Thunderbird Attachment Extractor - General 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:
    • #fromemail#_#date#_#namepart##count##extpart#
    • 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: jon.doe@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.

Troubleshooting

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:

Thunderbird Config Editor

The setting that reflect those we just set above are:

  • .actionafterextract.detach.mode
    • 0 = Delete with normal Thunderbird code
    • 1 = Delete with AE's internal routine
    • 2 = Detach with AE's internal routine
  • .excludepatterns4
    • 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 Smiling

Average: 4.7 (3 votes)
Select your preferred way to display the comments and click "Save settings" to activate your changes.

attachment extractor-1.2.2-tb.xpi

Would not install as it is not compatible with Thunderbird current version 3.0.6 !!

Detach IMAP Gmail Attachments in Thunderbird

I use Thunderbird to access a Gmail IMAP account... thus, the space I want to free up is in my online Gmail inbox. When I "Detach" an attachment in Thunderbird, it indeed looks like it removes the attachments from the message in Thunderbird. But when I login to Gmail, I see that the original message WITH attachments has NOT been deleted, it is still there as well.

Therefore, I am not actually freeing up any space in my Gmail account by "Detaching" the attachments. Does anybody know a way to get this to work as expected?

Detach vs. delete

That's interesting - with IMAP the action (detach) should take effect on the server (as opposed to POP, which merely transfers messages). Have you tried "delete" after saving the message to your PC to see if that makes a difference?

The other thing to try would be to see if there's a setting in Gmail you can adjust so that attachments are deleted on their server when you take an action in your mail client (Thunderbird).

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Textual smileys will be replaced with graphical ones.

More information about formatting options

CAPTCHA
This question is used to make sure you are a human visitor and to prevent spam submissions.