Message m = folder.getMessage(1); // set the DELETED flag m.setFlag(Flags.Flag.DELETED, true); // Check if DELETED flag is set of this message if (m.isSet(Flags.Flag.DELETED)) System.out.println("DELETED message"); // Examine ALL system flags for this message Flags flags = m.getFlags(); Flags.Flag[] sf = flags.getSystemFlags(); for (int i = 0; i < sf.length; i++) { if (sf[i] == Flags.Flag.DELETED) System.out.println("DELETED message"); elseif (sf[i] == Flags.Flag.SEEN) System.out.println("SEEN message"); }