I'm writing a thunderbird extension that should monitor one or more folders (from the left pane of the application) and if there are messages added to one of the monitored folders, they are sent automatically via webdav to a server (for archiving).
I found here how to iterate over all folders in all accounts. My question is how can I iterate over the messages (mails) in a folder