[dev] [PATCH] ActiveSync: Fix email sync error on corner case

Thomas Jarosch thomas.jarosch at intra2net.com
Thu Dec 12 11:41:50 UTC 2013


This fixes the "ERR: Unknown message." error in the ActiveSync log.

After adding debug output the involved data structures,
the data looked like this:

2013-12-12T12:24:24+01:00 ERR: HORDE [horde] Unknown message: uid: 65298, uidnext: 78953, minuid: 65298,
this->messages:
(
    [65298] => 0
    [65299] => 1
    [65300] => 2
    [65301] => 3
...
)

As the value of for $this->messages[65298] is 0, empty() will return true.
-> We have to use isset() for the test.
---
 framework/ActiveSync/lib/Horde/ActiveSync/Folder/Imap.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/framework/ActiveSync/lib/Horde/ActiveSync/Folder/Imap.php b/framework/ActiveSync/lib/Horde/ActiveSync/Folder/Imap.php
index e4b14ff..e067a1b 100644
--- a/framework/ActiveSync/lib/Horde/ActiveSync/Folder/Imap.php
+++ b/framework/ActiveSync/lib/Horde/ActiveSync/Folder/Imap.php
@@ -104,7 +104,7 @@ class Horde_ActiveSync_Folder_Imap extends Horde_ActiveSync_Folder_Base implemen
                 if ($this->modseq() > 0) {
                     $this->_changed[] = $uid;
                 } else {
-                    if (empty($this->_messages[$uid])) {
+                    if (!isset($this->_messages[$uid])) {
                         // Do not know about this message
                         throw new Horde_ActiveSync_Exception('Unknown message.');
                     }
-- 
1.7.11.7



More information about the dev mailing list