6.0.0-beta1
7/6/25

[#12245] Horde_Imap_Client::fetch returns non-existent changes
Summary Horde_Imap_Client::fetch returns non-existent changes
Queue Horde Framework Packages
Queue Version Git master
Type Bug
State Resolved
Priority 2. Medium
Owners slusarz (at) horde (dot) org
Requester mrubinsk (at) horde (dot) org
Created 05/11/2013 (4439 days ago)
Due
Updated 05/11/2013 (4439 days ago)
Assigned
Resolved 05/11/2013 (4439 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
05/11/2013 07:53:02 PM Michael Slusarz State ⇒ Resolved
 
05/11/2013 07:52:57 PM Git Commit Comment #3 Reply to this comment
Changes have been made in Git (master):

commit 03a643c704071735f6e3ff54636b41a2d08ca779
Author: Michael M Slusarz <slusarz@horde.org>
Date:   Sat May 11 13:52:28 2013 -0600

     Bug #12245: Lost passing options to _fetch()

  .../Imap_Client/lib/Horde/Imap/Client/Base.php     |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

http://git.horde.org/horde-git/-/commit/03a643c704071735f6e3ff54636b41a2d08ca779
05/11/2013 05:18:37 AM Michael Rubinsky Comment #2 Reply to this comment
In case it's not obvious, this is a typo:
// Shows HIGHESTMODSEQ is currently 66128

and should read 661128:

array(1) {
   'highestmodseq' =>
   string(6) "661128"
}
05/11/2013 05:17:26 AM Michael Rubinsky Comment #1
Priority ⇒ 2. Medium
Patch ⇒ No
Milestone ⇒
Assigned to Michael Slusarz
Queue ⇒ Horde Framework Packages
Summary ⇒ Horde_Imap_Client::fetch returns non-existent changes
Type ⇒ Bug
State ⇒ Assigned
Reply to this comment
I've just noticed that ActiveSync is detecting tons of unnecessary 
changes for email. This is resulting in what looks like a change being 
sent to the client for each email currently in the mailbox, everytime 
a sync is requested. This started sometime in the last few days.  The 
following code demonstrates this:

$imap = $registry->mail->imapOb();
$mbox = new Horde_Imap_Client_Mailbox('INBOX');
$status = $imap->status($mbox, Horde_Imap_Client::STATUS_HIGHESTMODSEQ);

// Shows HIGHESTMODSEQ is currently 66128
var_dump($status);

$query = new Horde_Imap_Client_Fetch_Query();
$query->modseq();
$query->flags();
$fetch_ret = $imap->fetch($mbox, $query, array(
     'changedsince' => '661128'
));

// Returns an array of 43 ids - the total number of emails in the mailbox.
var_dump($fetch_ret->ids());



The resulting imap.log:

------------------------------
Sat, 11 May 2013 01:13:29 -0400
S: * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID 
ENABLE IDLE STARTTLS LOGINDISABLED] Dovecot ready.
C: 1 STARTTLS
S: 1 OK Begin TLS negotiation now.
C: [LOGIN Command - username: mike]
S: 2 OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID 
ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS 
MULTIAPPEND UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED 
I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN 
CONTEXT=SEARCH LIST-STATUS] Logged in
CACHE: Using the Horde_Imap_Client_Cache_Backend_Cache storage driver.
C: 3 ENABLE QRESYNC
C: 4 STATUS "INBOX" (HIGHESTMODSEQ)
S: * ENABLED QRESYNC
S: 3 OK Enabled.
S: * STATUS "INBOX" (HIGHESTMODSEQ 661128)
S: 4 OK Status completed.
C: 5 EXAMINE "INBOX" (QRESYNC (1292457115 661128 
119945:119946,130457,158453,158777,159889,160243,163615,166864,167721,167753,168263:168264,169551,169571,169798,173015,173648,174802,175426,178421,178501,178573,179008,179044,179050,179067,179084,179120,179134,179196,179225,179229,179241,179314,179317,179446,179461,179471,179477,179481,179504:179505))
S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft $NotJunk 
$forwarded $Junk)
S: * OK [PERMANENTFLAGS ()] Read-only mailbox.
S: * 43 EXISTS
S: * 0 RECENT
S: * OK [UNSEEN 43] First unseen.
S: * OK [UIDVALIDITY 1292457115] UIDs valid
S: * OK [UIDNEXT 179506] Predicted next UID
S: * OK [HIGHESTMODSEQ 661128] Highest
S: 5 OK [READ-ONLY] Select completed.
SEARCH: Retrieved search from cache (mailbox: INBOX; id: 
a1000e9c41f56e01f5063113aa37d764)
CACHE: Retrieved messages (mailbox: INBOX; UIDs: 
119945:119946,130457,158453,158777,159889,160243,163615,166864,167721,167753,168263:168264,169551,169571,169798,173015,173648,174802,175426,178421,178501,178573,179008,179044,179050,179067,179084,179120,179134,179196,179225,179229,179241,179314,179317,179446,179461,179471,179477,179481,179504:179505)
C: 6 UID FETCH 
119945:119946,130457,158453,158777,159889,160243,163615,166864,167721,167753,168263:168264,169551,169571,169798,173015,173648,174802,175426,178421,178501,178573,179008,179044,179050,179067,179084,179120,179134,179196,179225,179229,179241,179314,179317,179446,179461,179471,179477,179481,179504:179505 
(MODSEQ)
S: * 1 FETCH (UID 119945 MODSEQ (519624))
S: * 2 FETCH (UID 119946 MODSEQ (593415))
S: * 3 FETCH (UID 130457 MODSEQ (550859))
S: * 4 FETCH (UID 158453 MODSEQ (615648))
S: * 5 FETCH (UID 158777 MODSEQ (616275))
S: * 6 FETCH (UID 159889 MODSEQ (618907))
S: * 7 FETCH (UID 160243 MODSEQ (619329))
S: * 8 FETCH (UID 163615 MODSEQ (626599))
S: * 9 FETCH (UID 166864 MODSEQ (634301))
S: * 10 FETCH (UID 167721 MODSEQ (636238))
S: * 11 FETCH (UID 167753 MODSEQ (651301))
S: * 12 FETCH (UID 168263 MODSEQ (637556))
S: * 13 FETCH (UID 168264 MODSEQ (637557))
S: * 14 FETCH (UID 169551 MODSEQ (641138))
S: * 15 FETCH (UID 169571 MODSEQ (651302))
S: * 16 FETCH (UID 169798 MODSEQ (641163))
S: * 17 FETCH (UID 173015 MODSEQ (648169))
S: * 18 FETCH (UID 173648 MODSEQ (651479))
S: * 19 FETCH (UID 174802 MODSEQ (651527))
S: * 20 FETCH (UID 175426 MODSEQ (654759))
S: * 21 FETCH (UID 178421 MODSEQ (658854))
S: * 22 FETCH (UID 178501 MODSEQ (659094))
S: * 23 FETCH (UID 178573 MODSEQ (659294))
S: * 24 FETCH (UID 179008 MODSEQ (659982))
S: * 25 FETCH (UID 179044 MODSEQ (660089))
S: * 26 FETCH (UID 179050 MODSEQ (660110))
S: * 27 FETCH (UID 179067 MODSEQ (660153))
S: * 28 FETCH (UID 179084 MODSEQ (660197))
S: * 29 FETCH (UID 179120 MODSEQ (660451))
S: * 30 FETCH (UID 179134 MODSEQ (661013))
S: * 31 FETCH (UID 179196 MODSEQ (661016))
S: * 32 FETCH (UID 179225 MODSEQ (660599))
S: * 33 FETCH (UID 179229 MODSEQ (660604))
S: * 34 FETCH (UID 179241 MODSEQ (660633))
S: * 35 FETCH (UID 179314 MODSEQ (660770))
S: * 36 FETCH (UID 179317 MODSEQ (660778))
S: * 37 FETCH (UID 179446 MODSEQ (660982))
S: * 38 FETCH (UID 179461 MODSEQ (661011))
S: * 39 FETCH (UID 179471 MODSEQ (661017))
S: * 40 FETCH (UID 179477 MODSEQ (661041))
S: * 41 FETCH (UID 179481 MODSEQ (661042))
S: * 42 FETCH (UID 179504 MODSEQ (661122))
S: * 43 FETCH (UID 179505 MODSEQ (661128))
S: 6 OK Fetch completed.
C: 7 LOGOUT
S: * BYE Logging out


Saved Queries