[英]Maintain IMAP message state information (imap flags) when using Javamail
We have a java app built by third party that opens a read/write IMAP connections, and retrieves certain messages. 我们有一个由第三方构建的Java应用程序,用于打开读/写IMAP连接并检索某些消息。 However it also marks them as "read".
但是,它也将它们标记为“已读”。 I am guessing this is due to fact that the app opens a read/write connection.
我猜这是由于该应用程序打开了一个读/写连接。 Is there a way we can prevent this app from updating the "read (seen)" imap flag?
有没有一种方法可以阻止此应用更新“已读(已看到)” imap标志? Maybe a parameter we can set when opening the connection to the IMAP?
也许在打开与IMAP的连接时可以设置的参数?
You can do this for a single message: 您可以针对一条消息执行此操作:
folder.setFlags(new Message[] {message}, new Flags(Flags.Flag.SEEN), false);
or for a list of messages: 或消息列表:
folder.setFlags(messageList, new Flags(Flags.Flag.SEEN), false);
where false
stands for UNREAD. false
代表UNREAD。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.