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.


Recommended solution

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.

Add a note

You could add a note to a message using an add-on such as Xnote++ or Message Notes Plus. The problem is that they don't physically change the message. You can't search for a note. If you use an IMAP account the note is not visible if you use a email client on another machine. If the add-on breaks (due to updating to a new version of Thunderbird) you might not be able to figure out a way to retrieve your notes.

Delete an attachment

Thunderbird 1.5 added 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.

Edit it as a draft

You could use Message -> Edit Message as New to edit it, save it as a draft, and then copy it to the original folder. This lets you modify the message body and add/delete attachments. The main disadvantage is that it creates a new message with you as the sender, uses the current date/time, and doesn't support editing any header other than the Subject. You could move a message to the Drafts folder and edit it there instead, but that loses more 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. That is 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 message using an add-on

  • The Header Tools Lite add-on lets you edit either just the Subject or the entire message. It supports both POP and IMAP accounts.
  • 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 a "inbox." file at ..\Mail\\ in the profile.

    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 separated by a blank line and a From_ line. That's 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 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.