Geroa is an open source java library which exposes email protocols as methods on a simple API. Currently this includes POP and SMTP, but work is underway on IMAP.
Geroa also includes a MimeMessage parser which simplifies manipulating emails which contains text, html and attachments.