Differences between revisions 4 and 5
Revision 4 as of 2009-03-15 22:47:45
Size: 2657
Editor: localhost
Comment: converted to 1.6 markup
Revision 5 as of 2016-04-23 00:34:21
Size: 1703
Editor: 82-181-77-11
Comment: \Marked vs \Unmarked only affects RECENT counts, while everybody wants UNSEEN. LIST is pointless for that.
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
Usually you're only interested about new messages that you haven't seen. If LIST replies have {{{\Marked}}} and {{{\UnMarked}}} flags, you can take advantage of them. If mailbox is {{{\UnMarked}}}, don't send STATUS to it. It most likely doesn't have any new messages. If mailbox is {{{\Marked}}}, it most likely has new messages. Then again, the {{{\Marked}}} state doesn't change after you have sent a STATUS to it.

All in all, your client's logic could be something like this:

 1. If STATUS hasn't been received from a visible mailbox for one hour, request it.
  * Use STATUS replies sent by the server even if you hadn't requested them!
 1. Every 5 minutes LIST visible mailboxes.
  * For every mailbox that's {{{\Marked}}}, but wasn't at the last check, send STATUS.
  * For every mailbox that's {{{\UnMarked}}}, do nothing.
  * For other mailboxes send STATUS if one hasn't been sent for last 15 minutes.
 1. If you've selected any of the mailboxes (in any connection), don't send STATUS to it.

When sending multiple LIST or STATUS commands, send them all at once pipelined so you don't waste time because of network latency.
When sending multiple LIST or STATUS commands, send them all at once pipelined so you don't waste time because of network latency. Take advantage of the LIST-STATUS extension if it's provided.

Mailbox Status in Mailbox List

Many clients show number of unseen messages next to the mailbox name in mailbox list. The clients usually do this by sending STATUS command to all mailbox every few minutes. STATUS can be expensive to some servers though, so this isn't really recommended. However since users want that feature, such recommendations are pretty useless. There are a few things you can do to lessen the server's load though.

When you're connected to the server and you've got the list of mailboxes, send STATUS only to the mailboxes visible in your mailbox list. If some child mailboxes aren't visible, it's pointless to waste server's time on calculating their status. Also don't send STATUS to selected mailbox. It works badly with some servers, and you already know the selected mailbox's state so it's pointless to send the STATUS. Instead use simply a NOOP (or CHECK or IDLE) to find out if the selected mailbox has new messages.

When sending multiple LIST or STATUS commands, send them all at once pipelined so you don't waste time because of network latency. Take advantage of the LIST-STATUS extension if it's provided.

Recent counters

Clients rarely use \Recent flag counters. They can be very useful for people who tend to leave messages unseen as a way of marking them as "act on later". Seeing "37 unseen" isn't very helpful if you've no intention of marking those 37 messages as \Seen anytime soon. Having a non-zero recent count for non-selected mailbox however means that the mailbox really has messages that you haven't seen before. Such mailboxes could perhaps be marked with bold font or some other way in the client's user interface.

None: ClientImplementation/MailboxListStatus (last edited 2016-04-23 00:34:21 by 82-181-77-11)