Switch from dnspython 1.12.0 to dnspython 1.11.1 .

Summary:
flanker 0.4.22 requires dnsq>=1.1.3. The latest version of dnsq
available is 1.1.3, which requires dnspython=1.11.1.
Wwe were installing dnspython 1.12.0 since
0e0f70614df2a3992e037e760a7097056ed17859 to avoid
https://github.com/rthalley/dnspython/issues/31 .
8a4b8c96eeffb950194c088df18ebe5437f2dcf2 of dnspython fixes the
aforementioned issue and is included in dnspython 1.11.1 so we safely
un-bump it.

Test Plan:
Create a new virtual machine from master (as is, before this fix), start
bin/inbox-start from /vagrant . /vagrant/inbox/util/startup.py should complain
indicating flanker 0.4.22 as the offending package (we should definitely
improve our error reporting on this kind of issues). bin/inbox-start won't
actually start.
Doing the same with this patch should solve the issue.

Reviewers: dlitz, emfree

Reviewed By: emfree

Differential Revision: https://review.inboxapp.com/D664
Refactor folder sync status management.

Summary:
Every sync monitor creates a single reader/multiple writer queue, which
will contain folder sync status events. The sync monitor spawns an
additional greenlet to consume the events in the aforementioned queue
(i.e., consumer greenlet). Greenlets executing the sync engine (i.e.,
producer greenlets) don't perform table (ImapFolderSyncStatus) updates
anymore; they push events to the queue, which is consumed by the
consumer greenlet that is in charge of performing table updates.

Events are tuples consisting of a folder identifier and the new state of
the producer greenlet managing said folder. The consumer greenlet keeps
a map from the folder identifier to the table (ImapFolderSyncStatus)
entry.

Test Plan:
Fire up the virtual machine, start bin/inbox-start and bin/inbox-auth to added
a few accounts. Start bin/redwood-start admin and double-check that folder sync
status gets changed from 'initial' to 'poll'.
This set of changes should not modify the behavior of inbox as a system.

Reviewers: khamidou, emfree

Reviewed By: emfree

Differential Revision: https://review.inboxapp.com/D656
Fix for ArcanistBaseUnitTestEngine deprecation.

Summary:
As reported in https://secure.phabricator.com/D9983 arcanist deprecated
a few base classes. Among them there is ArcanistBaseUnitTest, which we
were using.

As suggested by arcanist itself, PytestTestEngine now extends
ArcanistUnitTestEngine instead of ArcanistBaseUnitTestEngine.

Test Plan:
Checkout 52947cfd92b331916adffa1ff3233546446c881b for arcanist and
43a0b6d17bb097d76ef5ef936c91fa7448212cc2 for libphutil to see the warning
message from arcanist.
This patch removes the warning message.

Note: this patch may require all the developers to update their version of
arcanist and libphtil.

Reviewers: emfree

Reviewed By: emfree

Subscribers: spang, khamidou, kav-ya, emfree, dlitz

Differential Revision: https://review.inboxapp.com/D665
Search v1.0: Thread, message search for a namespace.

Summary:
1. Script to create an Elasticsearch index for each namespace and index its Threads, Messages
s.t. they can be queried on both thread/message attributes.

2. DSL query constructor to construct Elasticsearch DSL queries for
* no restrictions/ field-restricted/ all fields
* exact phrase/ any match
* equally weighted/ boosted
searches.

3. API functions.
4. Docs.

TODO:
1. Date range queries support.
2. Boost factor through API.
3. Expose in API: queries, score explanation.
4. Update docs.

Also,
Highlighting
Extend Gmail script to be more useful.

Test Plan:
Tests for:
Index creation.
Thread, message search.
Cross-attribute search.

Also basic script to test againt Gmail, using the Gmail Search API.

Reviewers: emfree

Reviewed By: emfree

Differential Revision: https://review.inboxapp.com/D672