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

Edit the message body

  • 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. The main disadvantage is that it creates a new message with you as the sender and the current date/time. So you may want to also use one of the methods in the next section to restore the visible headers.

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.

Edit the headers

  • The Header Tools extension lets you change the most common headers. It edits the message in place - it does not remove, edit and then replace it.
  • 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.

Change anything

  • 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.

  • You can use a text editor to directly modify the contents of the message in the mbox file. 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