Can someone please provide a solution to the problem in
How to connect to MailServer using JavaMail
I am stuck at the same point.
Hupa is the web-mail in the james project, it uses javaMail to retrieve messages from imap servers. You can take some code to connect with your server from the InMemoryIMAPStoreCache.java.