MozillaZine

Edit a stored message

From MozillaZine Knowledge Base

This article was written for Thunderbird but also applies to Mozilla Suite / SeaMonkey (though some menu sequences may differ).

There are several ways to edit a stored message. Which way is most appropiate depends upon what you want to edit, how many messages you're editing and whether you're comfortable editing a mbox file. A mbox file is a text file containing all of the messages for a folder. It has the folders name and no file extension, and is stored in the Profile.

Contents

Recommended

The HeaderToolsLite add-on is a simplified replacement for the obsolete TB Header Tools add-on. It supports editing the entire message. It will work with both POP and IMAP accounts and doesn't require you to know where or how Thunderbird stores messages.

Edit it as a draft

You can move a message to the Drafts folder, double click on it, edit it, save it as a draft, and then move it back to the original folder. This lets you change the message body and add/delete attachments. The main disadvantage is that it creates a new message with you as the sender and the current date/time, and doesn't support editing any header other than the Subject.

If you use this method to edit a message that has both a plain text and a HTML version of the message body it only keeps the version you edited. Thats determined by whether you're configured to compose a message as plain text or HTML. It also removes any attachments. If you want to keep a attachment you need to save or detach the attachment beforehand and then add it while editing the draft.

Rather than copying it to the Drafts folder you could use Message -> Edit Message as New to edit it, save it as a draft, and then copy it to the original folder. The main advantage is that preserves more of the headers, though it still uses the current date/time.

Edit the message using an add-on

  • The TB Header Tools add-on lets you change all of a message. It edits the message in place - it does not remove, edit and then replace it.

    It has been abandoned by the author. Scroll down the web page for several modified versions and a tutorial. If you want to use it with a recent version of Thunderbird install the add-on compatibility reporter add-on beforehand to disable version checking. If you do that ignore the warning about the TB Header Tools add-on being incompatible, that is just the add-on manager complaining that you ignored the maximum version limit in the extension.

  • The Dafizilla ViewSourceWith add-on is browser-centric but it also supports viewing and editing Thunderbird messages. It uses the XUL based built-in NsIEditor by default but also supports using an external editor. See the official web site for more information.

Edit a file that stores the message

  • You could exit Thunderbird, locate the mbox file that contains the message, and edit it using a text editor. Mbox files are text files that contain all of the messages for a folder and are named after the folder, with no file extension. For example, the inbox folder in a Gmail POP account would typically be at ..\Mail\pop.gmail.com\Inbox in the profile. Note the file has no file extension and is in a account directory named after the mail server.

    You should backup the mbox file before trying this but its safer than it sounds as long as you know enough to recognize the different MIME body parts and where each message ends. Each message is seperated by a blank line and a From_ line. Thats not the same thing as a From: header. The exact syntax of a From_ line depends upon the email client but Thunderbird stores it as a line beginning with "From", followed by a space, "-", another space and then the date. For example, From - Tue May 20 18:12:42 2008

  • You can save a message as a .EML file using Tools -> Save as -> File, edit it and then import it using either the Attachment Tools or the ImportExportTools extension. You need to use an extension since File -> Open Saved Message will display a .EML message but won't import it.

    The most convenient solution might be to use the ViewSourceWith extension to view the message using an external editor, edit it, save it with a .EML file extension, and then import it using the ImportExportTools extension.

Edit headers using a IMAP utility

If the message is stored in a remote folder (a IMAP account) you can use IMAPSize to modify any of the message headers.

Delete an attachment

  • Thunderbird 1.5 adds the ability to delete an attachment. However, what it really does is remove the contents of the attachment while keeping the headers, and adding a Deleted: prefix to the attachment filename. So unless you try to open the attachment or view the message source the only visible difference is the message size is smaller and the attachment filename has a Deleted: prefix. It currently does not change the Content-Length: header to reflect the new size.
  • The Attachment Tools extension can delete an attachment or zap an attachment (remove all traces of it). However, while you can install it using Thunderbird 1.5 it doesn't appear to delete or zap an attachment anymore. There is a dedicated thread for it in the Extensions forum.
  • If the message is stored in a remote folder (a IMAP account) you can use IMAPSize to delete an attachment.