Author Topic: Search  (Read 11421 times)


  • Full Member
  • ***
  • Posts: 169
Re: Search
« Reply #15 on: February 27, 2014, 06:09:34 am »
My IMAP search code works in batches, trying to avoid overloading the server with asking for every matching message up front (which there could be a lot of).

Think of iterating an array, using an index.

On the other hand, sounds like 1und1's IMAP server somehow manages to get slower and slower as the search window gets further down the list.

( A Gmail folder with 88000 messages is equally fast when searching near the top vs. near the bottom of the list... just another data point... )
I will try this again on my own connection.
Does the search ask the server for "the first/next 25 matches", or all the matches in the first/next nnn messages? It looks like the second of these cases.
If the first, then it could get slower if matching items happen to be more sparse going back in time. It does not account for it stopping, but that might relate to the connection I was using.

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Search
« Reply #16 on: March 03, 2014, 01:56:24 am »
Unfortunately, the IMAP command that works like "give me N more matches" is only available with an extension, and one that's pretty rare in the real world.

So the code iterates through the mailbox's entire message range, and asks for "any matches within this range of messages".

Even so, the commands that return no matches should complete pretty quickly (unless you're on a very high latency mobile connection, for example), and you should be seeing the app's search progress update (bottom of the list).

As usual, I'm open to debug logs.
Creating debug logs for diagnostics:

The official FAQ:

Лог-файлы для диагностики:

Вопросы и ответы: