[sync] Search timeout problems

Iain McFarlane iain at imcfarla.homelinux.net
Sat Jan 11 11:10:09 UTC 2025


Hello,

I finally had some time to investigate why search never works on my 
phone when using Activesync against horde.

It appears the request comes from the phone and is processed but then 
the phone times out before the result is sent back to it.

I have put in a patch to limit the number of folders to search through 
to just "special" folders and at least this gets some results back.

--- Adapter.php.orig    2025-01-11 10:51:58.222106199 +0000
+++ Adapter.php    2025-01-11 11:00:06.424379118 +0000
@@ -946,8 +946,26 @@
              }
          }
          if (empty($mboxes)) {
-            foreach ($this->getMailboxes() as $mailbox) {
-                $mboxes[] = $mailbox['ob'];
+/**
+ *           // Process each and every mailbox
+ *
+ *           foreach ($this->getMailboxes() as $mailbox) {
+ *                $mboxes[] = $mailbox['ob'];
+ *           }
+ */
+
+/**
+ *          Add only special mailboxes to the search list
+ *          Exclude Templates, Trash and any mailbox without a name
+ *
+ */
+            // Special folders misses out inbox so add it manually!
+            $mboxes[] = new Horde_Imap_Client_Mailbox('INBOX');
+            foreach ($this->getSpecialMailboxes() as $mailbox) {
+                // Ignore Templates and Trash folder and a weird blank one
+                if ($mailbox->basename != "Templates" && $mailbox->basename != 'Trash' && $mailbox->value != "") {
+                    $mboxes[] = new Horde_Imap_Client_Mailbox($mailbox->value);
+                }
              }
          }
          foreach ($mboxes as $mbox) {

But this can't be right.  There must be a timeout or a progress message 
we can send back to stop the phone from timing out.

Any thoughts?

Regards,

Iain


More information about the sync mailing list