What was the reason you needed to export into a database?
We have an IMAP folder with about 7000 messages in it that several of us have to search on a regular basis. Whilst IMAP is a wonderful thing, searching through a large amount of messages was taking a long time.
We now use Xeoport to automatically import messages from the IMAP store into a MySQL database and use a PHP script to search that instead. It's an order of magnitude quicker to find the stuff we need now

The other advantage is that if the message is for technical support or something similar, we use the PHP app. to write a reply which is sent by email, and the message and reply are also automatically made available on the web via an appropriately configured i-Bay for future reference.
Hope this answers your question!