Hi,
Since a couple of days I'm trying to configure a way of popping mails from a mailbox. When looking at the code of MailFolder, I'm wondering if the getNewMessages() method is supposed to work.
First of all there is an interesting comment: "This does not seem to be the most reliable new msg check"
MailFolder.java: public Message[] getNewMessages() /* This does not seem to be the most reliable new msg check. This should probably be unread msgs with the msgs marked as read on successful delivery. */ if (folder.hasNewMessages() { ... }
POP3Folder.hasNewMessages() Always returns false; the POP3 protocol provides no way to determine when a new message arrives.
Changing the protocol to be used from POP3 to IMAP solves this issue. Based on this experience I conclude that JBoss does not support the polling of a mailbox with POP3.
Jira issue: https://jira.jboss.org/jira/browse/JBPAPP-1177