Is it possible to set custom flags on IMAP mail messages using java mail without overwriting existing flags? Eg, I need to set a flag \"processed\" on processed messages wit
Flags processedFlag = new Flags("processed");
folder.setFlags(msgs, processedFlag, true);
// or
msg.setFlags(processedFlag, true);
Not all IMAP servers will support these "user flags", but most will. To find messages without this flag:
Message[] msgs = folder.search(new FlagTerm(processedFlag, false));