Google 網路論壇不再支援新的 Usenet 貼文或訂閱項目,但過往內容仍可供查看。

Changing the contents of a saved email

瀏覽次數:0 次
跳到第一則未讀訊息

Einar Egilsson

未讀,
2006年11月11日 凌晨3:53:472006/11/11
收件者:
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

未讀,
2006年11月14日 清晨5:20:152006/11/14
收件者:
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")

未讀,
2006年11月14日 清晨5:34:392006/11/14
收件者:

"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

未讀,
2006年11月15日 下午3:37:272006/11/15
收件者:

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 則新訊息