6.3.3 mail.imap.peek
When mail.imap.peek is set to true, it uses the IMAP PEEK option while fetching body parts, to avoid setting the SEEN flag on messages.
Description
When mail.imap.peek is set to true, it uses the IMAP PEEK option while fetching body parts, to avoid setting the SEEN flag on messages. The default value is false. This option can be overridden for individual messages by using the setPeek method on IMAPMessage.
Specifiable values
Type: Boolean
{true | false}
Example
Properties properties = new Properties(); properties.setProperty("mail.imap.peek", "true"); Session session = Session.getDefaultInstance(properties); Store store = session.getStore("imap"); store.connect("user", "password"); messages = folder.getMessages();