Is it possible to forward emails as they arrive to a script? Does thunderbird, or outlook have an api for such a thing?
Let me narrow the question down, I know that there is a way to manually export an email to a text file in outlook, and I know there is also a way to add rules to emails. But is there a way to add a rule to emails that would make them export them?
It is probably easiest to do this by downloading the messages from the server, using POP3 or IMAP4, rather than trying to integrate with mail clients.
There are tools available to access an IMAP mailbox and save messages as .eml files – there may also be tools to do it via POP3.
I haven’t tested any, but one tool that comes up on a quick search is http://www.broobles.com/imapsize/imap-backup.php
I recently wrote a program at work, which connects via IMAP and retrieves the message source, then pops it into a .eml file. If you are a proficient programmer, it isn’t very difficult, provided you use a native IMAP class and can follow the relevant RFC documentation if you get stuck.