Retrieving all unread emails using javamail with POP3 protocol
Your code should work. You can also use the Folder.getUnreadMessageCount() method if all you want is the count. JavaMail can only tell you what Gmail tells it. Perhaps Gmail thinks that all those messages have been read? Perhaps the Gmail web interface is marking those messages read? Perhaps you have another application monitoring the folder … Read more