Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
3.4.0
-
None
-
None
-
Ubuntu 18.04
Oracle Java 1.8.0_211
Description
Using a POP3 connection to James from a Java application deleting emails from the INBOX folder (only tested INBOX) is not working. This worked fine in 3.3.0 and previous versions. I currently have both versions (3.3.0 and 3.4.0) installed and consistently have this issue with 3.4.0. When I switch back to 3.3.0 it works perfectly.
Below is the basic code I'm running.
emailFolder.open(Folder.READ_WRITE);
Message[] messages = emailFolder.getMessages();
for (int i = 0; i < messages.length; i++) {
messages[i].setFlag(Flags.Flag.DELETED, true);
}
emailFolder.close(true);
This is the Java API I'm using.
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.6.2</version>
</dependency>