Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Changing the contents of a saved email

0 views
Skip to first unread message

Einar Egilsson

unread,
Nov 11, 2006, 3:53:47 AM11/11/06
to
Hi

Does anyone know if I could change the body content of an email I
received and save the changes somehow? I know how to get the nsIMsgDbHdr
but I need to change the actual body content, and I need a way to save
it. I know the mailbox files are just text files, but I really don't
wanna go around parsing those, I'm looking for a supported way to do
this. Any ideas?

thanks
-einar-

michaeljgru...@fastmail.fm

unread,
Nov 14, 2006, 5:20:15 AM11/14/06
to
Einar Egilsson venit, vidit, dixit 2006-11-11 09:53:

I don't think there's a supported way for doing that. The HdrTools
extension jumps through some loops to do that and get's it right on some
IMAP servers and mails only.

Maybe check how TB/mailnews detaches and deletes attachments? That code
needs to edit the body, too.

Michael

Gijs Kruitbosch ("Hannibal")

unread,
Nov 14, 2006, 5:34:39 AM11/14/06
to

"Edit as New" (Message menu) also gets you a new mail with the same body
content, editable and all. Perhaps you could see how that does it? :-)

-- Gijs

Einar Egilsson

unread,
Nov 15, 2006, 3:37:27 PM11/15/06
to

Thanks guys for the ideas. I've decided to not change the actual email.
I'm doing this for an extension that saves remote images locally, and my
first idea was to replace them in the email with a data:uri with the
base64 encoded image, but I've since decided to just keep the remote
images in a folder and replace them on message load. Then if the
extension is uninstalled you've got your mail the same way that it was.

Another question, do you know how I can allow an <img> tag to link to a
file:// url? I've tried to replace it with data:uri and just putting the
base64 stuff in there, but I'd rather not keep encoding and decoding the
images, instead I just want to link to them.

-einar-

0 new messages