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

Thunderbird attachments information from message header

49 views
Skip to first unread message

Teemu Hautala

unread,
Apr 14, 2009, 4:54:39 PM4/14/09
to
Hi,

I see that this has been asked bunch of times here already, but couldn't
find an answer to the problem as of yet.

Simply put, I need to get information if an arriving message has
attachments without selecting it through the UI, and then get some basic
info about the attached file. I have the message header through the
nsIFolderListener and already do bunch of stuff with it.. but there is
no information about possible attachments in it yet. Only a method for
marking that the message has an attachment.

nsIMsgAttachment seems to be for message composing, as previously mentioned.

Is there really no way to do this other than through UI? I noticed that
there isn't even a filter option that lets you parse for attachments.

Teemu Hautala

unread,
Apr 14, 2009, 6:54:55 PM4/14/09
to

If there is no way of getting attachment information neatly without
loading the message in the UI, I'm thinking of implementing my own
parser for it if I could just get the raw message source somehow. I
searched a bit and this seems to be equally difficult though =(

Any advice is greatly appreciated.

Teemu Hautala

unread,
Apr 15, 2009, 4:26:23 PM4/15/09
to
Hi again.

I finally managed to find a way to get the raw message, by following
instructions in here:

http://simon-cozens.org/programmer/articles/thunderbird-js.pod

It works beautifully, but now I have a new problem: because I need to
use the streamlistener to get the raw message for IMAP mails, I lose the
message header object during the process. I need it to process the
message further, along with the raw message body.

Thus, I need one of the following:

1. Pass the message header object to the StreamListener
2. Wait for the raw message body in my function which starts the
messageService.CopyMessage(...) request
3. Somehow generate the header object from the raw message body

I guess number one is out... unless I use some kind of global variable
to store the header (which infact, I will try now =)

Neil

unread,
Apr 16, 2009, 7:13:05 AM4/16/09
to
Teemu Hautala wrote:

> Pass the message header object to the StreamListener

Just set the header as a property on your user-defined stream listener.

--
Warning: May contain traces of nuts.

Andrew Sutherland

unread,
Apr 20, 2009, 7:49:06 AM4/20/09
to
0 new messages