Mailster is a project aimed at testing software mail capabilities. It provides a mail server container to test emails sent by your apps without rewriting your application code.
JFoxMail is a opensource J2EE webmail application. Access to read from IMAP account, Compose using SMTP, and Address Book management using LDAP is supported.