MBOX-Line: From guenther+imap at sendmail.com  Sun Nov  6 14:02:57 2011
To: imap-protocol@u.washington.edu
From: Philip Guenther <guenther+imap@sendmail.com>
Date: Fri Jun  8 12:34:47 2018
Subject: [Imap-protocol] [noob] select & unseen?
In-Reply-To: <FC7BC111-BCF3-41CB-90E8-52980C306356@mac.com>
References: <C61A1BDF-03DD-4ED9-BFCA-C6183F07DD3E@mac.com>
	<20111106213124.GA27889@brong.net>
	<FC7BC111-BCF3-41CB-90E8-52980C306356@mac.com>
Message-ID: <alpine.BSO.2.00.1111062200200.19519@morgaine.smi.sendmail.com>

On Sun, 6 Nov 2011, Petite Abeille wrote:
...
> 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" 
...
> 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]

Live by the ABNF:

response-data   = "*" SP (resp-cond-state / resp-cond-bye /
                  mailbox-data / message-data / capability-data) CRLF
resp-cond-state = ("OK" / "NO" / "BAD") SP resp-text
resp-text       = ["[" resp-text-code "]" SP] text
text            = 1*TEXT-CHAR

Ergo, the close bracket must be followed by a space and at least one other 
character before the CRLF.  If it fails to do that, then it's not actually 
a response code!


Philip Guenther

