[Tickets #11679] Imap_Client: Offset gets added to uidnext

bugs at horde.org bugs at horde.org
Fri Nov 9 14:29:58 UTC 2012


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/11679
------------------------------------------------------------------------------
  Ticket             | 11679
  Created By         | Thomas Jarosch <thomas.jarosch at intra2net.com>
  Summary            | Imap_Client: Offset gets added to uidnext
  Queue              | Horde Framework Packages
  Version            | Git master
  Type               | Bug
  State              | Unconfirmed
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


Thomas Jarosch <thomas.jarosch at intra2net.com> (2012-11-09 14:29) wrote:

Hi,

the Kolab_Storage module uses a combination of uidvalidity, uidnext  
and the number of items in a folder to determine if it changed (this  
will work 99% reliable).

During my various tests I learned the hard way that uidnext is not  
what it seems to be:
An offset gets added to it. The problematic code is in  
Imap/Client/Socket.php:4117.
-------------------------------------------
     protected function  
_serverResponse(Horde_Imap_Client_Interaction_Server $ob)
     {
...
         default:
             // Next, look for responses where the keywords occur second.
             $first = $token->current();

             switch (strtoupper($token->next())) {
             case 'EXISTS':
                 // EXISTS response - RFC 3501 [7.3.2]
                 $mbox_ob = $this->_mailboxOb();
                  
$mbox_ob->setStatus(Horde_Imap_Client::STATUS_MESSAGES, $first);

                 // Increment UIDNEXT if it is set.
                 if ($uidnext =  
$mbox_ob->getStatus(Horde_Imap_Client::STATUS_UIDNEXT)) {
                      
$mbox_ob->setStatus(Horde_Imap_Client::STATUS_UIDNEXT, $uidnext +  
$first);
                 }
                 break;
-------------------------------------------

Here an offset "$first" is added to $uidnext. With my specific test,  
this turned out to be the exact next "uidnext" value so Kolab_Storage  
skipped syncing the folder even though it changed.

Why is an offset added to uidnext?
(git blame mentions some fix for "condstore + modseq").

Thomas






More information about the bugs mailing list