I have found that creating a pop3 connection to the server i was able to download all the current messages to outlook. now i can export all the data needed. It is recommended to use IMAP to sync email but for my main purpose of downloading all the emails i had to use pop3.
Update: keep in mind that only the headers will be download, you need to tell outlook to download complete item including attachments.