MBOX-Line: From David.Harris at pmail.gen.nz  Sun Nov  6 16:45:00 2011
To: imap-protocol@u.washington.edu
From: David Harris <David.Harris@pmail.gen.nz>
Date: Fri Jun  8 12:34:47 2018
Subject: [Imap-protocol] [noob] select & unseen?
In-Reply-To: <C61A1BDF-03DD-4ED9-BFCA-C6183F07DD3E@mac.com>
References: <C61A1BDF-03DD-4ED9-BFCA-C6183F07DD3E@mac.com>
Message-ID: <4EB72A0C.31264.813832F8@David.Harris.pmail.gen.nz>

On 6 Nov 2011 at 21:15, 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: 
> 
> On the other hand, the spec for SELECT seems to mandate returning
> all the data: "the server MUST send the following untagged data". 

It is in the very nature of [UNSEEN] that it *cannot* be sent if the 
mailbox has no unread messages: the ABNF requires its parameter to 
be an nz-number, but there is no possible valid nz-number that can be 
sent in such a situation. Simple commonsense dictates that the 
intention of the RFC must be that [UNSEEN] is mandatory *if the 
mailbox contains any unread messages*, but that it *must* in fact be 
*omitted* otherwise.

Thanks for this thread - it has lead to a minor correction in my server 
(an oversight that I found when I went to check that I was in 
compliance).

Cheers!

-- David --

------------------ David Harris -+- Pegasus Mail ----------------------
Box 5451, Dunedin, New Zealand | e-mail: 
David.Harris@pmail.gen.nz
           Phone: +64 3 453-6880 | Fax: +64 3 453-6612

True life insurance claim:
   "I saw a slow-moving, sad-faced old gentleman as he
    bounced off the hood of my car."




