Once again, I hit a kind of a brick wall... How could I go through all
the messages in a given Thunderbird message folder, namely I want to
process their headers (not only new/unread messages, but all of them).
I am developing an extension which will sort and gather information
about messages, but currently it only processes messages which are
received while TB is running. I need functionality to scan for new
messages at startup, and manually scan a folder initiated by user. As a
starting point I just have the nsIMsgFolder element.
nsIMsgFolder has a method getMessages(), but I'm not sure what it
actually does or how you're supposed to use it. Didn't find any good
reference for it so far. Or should I use the search functionality somehow?
Thanks.
And again, managed to get the getMessages() work just little after
sending a message:
iMessages = aFolders[0].getMessages(null); // get the messages
while(iMessages.hasMoreElements()) {
var iHdr =
iMessages.getNext().QueryInterface(Components.interfaces.nsIMsgDBHdr);
// doing something with the hdr
}
Now just have some issues with timing or variable scope, because that
while loop only succeeds to process the first message... but I guess
that will be solved tomorrow, hopefully.