There is no simple answer.

If you EXAMINE the mailbox, leave it open, and there is a shared lock, it is
possible that the owner of the mailbox may discover the monitoring if an
EXPUNGE returns a "can't do it because someone else has a shared lock" error.

On the other hand, EXAMINE may also fail to observe new mail ever, if the mail
store's operation of "load new mail to INBOX" is done by a read-write open.

You can certainly SELECT the mailbox, but then you run the risk of acquiring
an exclusive lock, so you have those potential problems in addition to shared
lock problems.  Furthermore, SELECT will cause \Recent flags to be "lost" if
your monitoring session sees the mailbox first.

The bottom line is that IMAP was not designed to facilitate long-term
unobtrusive monitoring, and so its monitoring capabilities are basically
"snoop at a snapshot."

Reply via email to