[Imap-protocol] [noob] select & unseen?

Petite Abeille petite_abeille at mac.com
Sun Nov 6 13:51:16 PST 2011



On Nov 6, 2011, at 10:31 PM, Bron Gondwana wrote:


> On Sun, Nov 06, 2011 at 09:15:34PM +0100, Petite Abeille wrote:

>> Given a mailbox containing only \Seen messages, what kind of UNSEEN response is SELECT supposed to return?

>>

>> Looking at, say, dovecot implementation, it doesn't return any UNSEEN data if all messages are \Seen:

>>

>> if (status.first_unseen_seq != 0) {

>> client_send_line(client,

>> t_strdup_printf("* OK [UNSEEN %u] First unseen.",

>> status.first_unseen_seq));

>> }

>

> Cyrus does the same:

>

> if (state->firstnotseen)

> prot_printf(state->out, "* OK [UNSEEN %u] Ok\r\n",

> state->firstnotseen);


Ok, that settles it I guess :)


> Ok - I think I've deciphered it. You MUST NOT select mailboxes

> unless they have unseen messages in them. Problem solved.


That's one way to look at it :P

One more minor clarification...

In the example above, both dovecot and cyrus suffix the response with a bit of free form text:

* OK [UNSEEN 123] First unseen. <- "First unseen."
* OK [UNSEEN 123] Ok <- "Ok"


>From the spec:


* OK [UNSEEN 12] Message 12 is first unseen <- "Message 12 is first unseen"

Is that trailing text mandatory? It doesn't seem to add much of anything functional to the response. Can the response dispense with it?

* OK [UNSEEN 123]

Thanks.








More information about the Imap-protocol mailing list