MBOX-Line: From tonio at ngyn.org  Sun Apr 15 00:40:46 2012
To: imap-protocol@u.washington.edu
From: Antoine Nguyen <tonio@ngyn.org>
Date: Fri Jun  8 12:34:48 2018
Subject: [Imap-protocol] Unseen messages question
Message-ID: <4F8A7B7E.9080709@ngyn.org>

Hi list,

I'm trying to understand what is the more efficient way to maintain the
number of unseen messages of the currently selected mailbox. RFC3501 says a
client must not issue a STATUS command to a selected mailbox and that
information sent by a SELECT is enough.

My current idea follows these steps :
* Issue a STATUS before the mailbox is selected =>  I know how many unseen
messages it contains
* SELECT the mailbox =>  I got the eventual first unseen message in this
mailbox but I don't understand how this info can be useful
* Maintain the unseen counter (on client side) according to what the user do
* Send a NOOP command every X minutes and look at the RECENT response to
see if there are new messages

I think it works pretty well when the mailbox is opened only once. Let's
imagine this mailbox is opened twice, by different clients. If one client
marks a message as \Seen, how can the second client know about this change?

Thanks for your help,

Antoine Nguyen
http://modoboa.org/


