Poll a Microsoft Exchange mailbox from OSB using DavMail

The Oracle Service Bus has built in features to poll an IMAP of POP3 mail account. There are loads of excellent blog posts that exactly describe how to do it. However, when the mail server happens to be a Microsoft Exchange server, things become shady. Exchange’s IMAP implementation tends to be not really that compatible, and the server log will fill up with stacktraces such as:

javax.mail.MessagingException: Connect failed;
  nested exception is:
        java. (more...)