MBOX-Line: From slusarz at curecanti.org  Fri Dec 28 10:27:25 2012
To: imap-protocol@u.washington.edu
From: Michael M Slusarz <slusarz@curecanti.org>
Date: Fri Jun  8 12:34:49 2018
Subject: [Imap-protocol] Missing UIDNEXT during mailbox synchronization
In-Reply-To: <db123879-1082-4911-b7ce-3a861d62217a@flaska.net>
References: <db123879-1082-4911-b7ce-3a861d62217a@flaska.net>
Message-ID: <20121228112725.Horde.cM7EjLQoqQDix9dQMs5KcA1@bigworm.curecanti.org>

Quoting Jan Kundr?t <jkt@flaska.net>:

> Hi,
> I've received a report that Courier 4.5.0 sometimes doesn't return  
> UIDNEXT when syncing a mailbox, violating RFC 3501. Trojita used to  
> hit an assert in such case which was clearly my bug. This has now  
> been fixed.

Courier definitely does this, and it is not against spec.  From RFC 3501:

          OK [UIDNEXT <n>]
                      The next unique identifier value.  Refer to section
                      2.3.1.1 for more information.  If this is missing,
                      the client can not make any assumptions about the
                      next unique identifier value.

For cache purposes, you can workaround a missing UIDNEXT response by  
doing a 'UID FETCH * (UID)' in the mailbox.  For empty mailboxes, use  
the returned UID value (which is defined as the UIDNEXT value).   
Otherwise, you can add 1 to the returned value and use this as the  
UIDNEXT-ish value.

michael


