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-
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
"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
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-