[horde] Server side email searches with ActiveSync not working

Sebastian Arcus s.arcus at open-t.co.uk
Thu Apr 26 07:55:42 UTC 2018

On 26/04/18 01:44, Michael J Rubinsky wrote:
> Quoting Sebastian Arcus <s.arcus at open-t.co.uk>:
>> On 18/04/18 09:08, Sebastian Arcus wrote:
>>> On 17/04/18 14:53, Sebastian Arcus wrote:
>>>> On 17/04/18 13:16, Ad-Min wrote:
>>>>> Sebastian Arcus-2 wrote
>>>>>> I am struggling to get server side email searches working with 
>>>>>> ActiveSync.
>>>>>> My setup is:
>>>>>> Lighttpd 1.4.49
>>>>>> Dovecot 2.2.33
>>>>>> Exim 4.90
>>>>>> PHP 5.6.35
>>>>>> Postgresql 9.2.24
>>>>>> Horde 5.2.17


>>> Now everything is working fine and server-side searches return 
>>> results correctly. I thought I would post here, in case anyone else 
>>> stumbles over the same problem.
>> I am sorry to report that this problem has reared its head again. The 
>> server-side email searches through ActiveSync are being so 
>> unpredictable to the point that 1 in 20 might work.
> This works for me without issue. Sometimes it *is* a bit slow, but I get 
> consistent results. A search for "activesync" issues the following:
>>> Slow Command: 15.069 seconds
> 386679,386678,386670,386660,386659,386638,386529,386528,386522,386519,385900,385856,385850,385824,385820,385812,385328,383433,383348,383312,383310,372739 
> COUNT 22
> S: 8 OK Sort completed (0.234 + 0.001 + 0.001 secs).
>>> Command 8 took 0.275 seconds.

Thank you for that. Which logs are these snippets from and on what 
logging level please? In Horde I could only find those XML style 
messages in the ActiveSync log on full debug (but maybe I wasn't looking 
in the right place). I could really do with something like the above.

>> My Dovecot server has Lucene full text indexing enabled, and if a run 
>> a BODY search through Thunderbird, passing the search to the server 
>> over IMAP, the results come back in 2 seconds, on an Inbox with 20 000 
>> emails.
> The ActiveSync log you posted earlier shows that you are searching ALL 
> mailboxes, not just your INBOX.

That is true - at least the Jolla phone email client doesn't seem to 
have any option to search just one folder. I will have another look at 
the iPhone clients.

>> The same search executed from a phone through ActiveSync doesn't 
>> return any results.
>> I've turned up debugging all the way up in Dovecot, and when searching 
>> from the phone, all I see is just a bunch of EXAMINE imap commands - 
>> no SEARCH command. I don't know if Horde is supposed to use SEARCH 
>> imap command, or has a different way of doing server side email searches?
> Depending on your server and CAPABILITIES, you might be using the IMAP 
> SORT extension (RFC-5256).

Just as an aside, looking at the initial ActiveSync log I posted, would 
I be correct in reading that the client asks for a subset of the search 
results - either 100 or 255? I can see "Search:Range" and 
"AirSyncBase:Preview" with those values - but maybe it is not related? I 
was wondering if searching for a word which is likely to return a lot of 
results will return a partial number of search results - and maybe that 
adds further to my confusion?

Thank you again for the information

More information about the horde mailing list