[horde] Server side email searches with ActiveSync not working

Sebastian Arcus s.arcus at open-t.co.uk
Tue Apr 17 13:53:40 UTC 2018


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
>>
>> I have tested imap searches through Thunderbird (there is an option "run
>> search on server) and it is working fine and fast. I assume this means
>> Dovecot is configured correctly and can do imap searches?
>>
>> I have tested the Horde email searches on an iPhone 5S with iOS 11.2.6
>> and a Jolla phone with Sailfish 2.1. Both of them have email configured
>> in ActiveSync mode. On both of them, if I force them to search on the
>> server only, they sit there saying "searching" for a few minutes, and
>> then return no results (and no error either).
>>
>> On the server side, I can see the command being sent by the device to
>> Horde in the individual device ActiveSync log (I've removed the
>> timestamps for brevity):
>>
>> [12466]INFO: ----------SEARCH request received for user
> 
>> myusername@
> 
>> [12466][2018-04-16T15:27:38+01:00] INFO: ----------Request being handled
>> for device: JP359745050349650, Supporting protocol version: 14.0, Using
>> Horde_ActiveSync v2.39.2
>> [12466] I:
>> <Search:Search>
>> [12466] I:
>> <Search:Store>
>> [12466] I:
>> <Search:Name>
>> [12466] I:     Mailbox
>> [12466] I:
>> </Search:Name>
>> [12466] I:
>> <Search:Query>
>> [12466] I:
>> <Search:And>
>> [12466] I:
>> <Search:FreeText>
>> [12466] I:       dea
>> [12466] I:
>> </Search:FreeText>
>> [12466] I:
>> <FolderType>
>> [12466] I:       Email
>> [12466] I:
>> </FolderType>
>> [12466] I:
>> </Search:And>
>> [12466] I:
>> </Search:Query>
>> [12466] I:
>> <Search:Options>
>> [12466] I:
>> <Search:Range>
>> [12466] I:      0-100
>> [12466] I:
>> </Search:Range>
>> [12466] I:
>> <Search:DeepTraversal />
>> [12466] I:
>> <Search:RebuildResults />
>> [12466] I:
>> <AirSyncBase:BodyPreference>
>> [12466] I:
>> <AirSyncBase:Type>
>> [12466] I:       2
>> [12466] I:
>> </AirSyncBase:Type>
>> [12466] I:
>> <AirSyncBase:AllOrNone>
>> [12466] I:       1
>> [12466] I:
>> </AirSyncBase:AllOrNone>
>> [12466] I:
>> <AirSyncBase:Preview>
>> [12466] I:       255
>> [12466] I:
>> </AirSyncBase:Preview>
>> [12466] I:
>> </AirSyncBase:BodyPreference>
>> [12466] I:
>> <MIMESupport>
>> [12466] I:      0
>> [12466] I:
>> </MIMESupport>
>> [12466] I:
>> </Search:Options>
>> [12466] I:
>> </Search:Store>
>> [12466] I:
>> </Search:Search>
>>
>> But I just can't be sure it is actually passed to Dovecot - at least I
>> can't see anything in the Dovecot logs to indicate that.
>>
>> Are there any other settings needed for ActiveSync server side email
>> searches to work? Can I troubleshoot this further, or look in any other
>> logs?
>>
>> Any advice much appreciated.

> 
> 
> 
> I had a similar issue (windows, hmailserver as backend). My problem was not
> that it doesn't work, but rather that clients timed out searching very large
> mailboxes. I was not able to fix this, but it works fine on smaller
> mailboxes. You didn't mention anything about mailbox size, so I'm just
> throwing this out there.
> 
> I looked at my imap logs on hmailserver and confirmed that the search was
> actually talking place. The issue was the search took about 4 minutes to
> complete and the clients (all that I tried) timed out after 60 or 90
> seconds.
> 
> I would start by enabling imap logging in your mail server and looking to
> see if the search is actually talking place. Likely it is (since that is a
> working function of horde activesync), so maybe you can track down the error
> from there.

Thank you for answering and the suggestions. In the meanwhile I have 
spent a number of hours last night investigating. One of the 
possibilities I considered is large mailboxes which would mean long 
search time. I logged over telnet to Dovecot and manually ran a SEARCH 
BODY imap command. This indeed took over 5 minutes to return results.

Then I configured Lucene FTS indexing plugin in Dovecot - and after 
indexing the mailbox, the search started over the telnet session went 
down to less then 1 second! Still, no joy over ActiveSync.

Then I went and enabled debugging in Dovecot to the highest level of 
verbosity. Still, there is no sign of SEARCH commands being sent from 
Horde to Dovecot. I'm not really sure what is happening, but the 
ActiveSync server-side email search seems to be broken somehow. I have 
posted a bug report at Horde.org - maybe someone will get a chance to 
look into this.


More information about the horde mailing list