[oauth/logging] Change when / how we log oauth errors so that we can provide the account id.

Summary: As has been noticed, logging for oauth errors needed a little lovin'. Do that.

Test Plan: regression

Reviewers: emfree

Reviewed By: emfree

Differential Revision: https://review.inboxapp.com/D455
[events] Better handling of eroneous events.

Summary:
There are a few accounts which have invalid events (e.g. cancelled in
gmail, or unable to get info from icloud). Currently our logs are pretty bloated
and these particular issues are minor. As such, handle these in a less noisy fashion.

Test Plan: regression

Reviewers: emfree

Reviewed By: emfree

Differential Revision: https://review.inboxapp.com/D454
[oauth] Fix signature for _new_token.
[auth/outlook] Fix the call to verify_account that was providing too many parameters.
[events/polling] Change default poll frequency for outlook.com
[events/outlook] Better error reporting when obtaining events.
[oauth] Re-raise oauth errors after logging.
[SCHEMA] Remove webhooks and zerorpc dependency.

Summary:
Webhooks are being replaced by the ping API; this commit just rips out a bunch
of now deprecated code, and finally gets rid of the last of our ZeroRPC
dependencies.

Test Plan: py.test tests

Reviewers: charles

Reviewed By: charles

Differential Revision: https://review.inboxapp.com/D459
[auth/oauth] Properly tranlsate authentication errors in outlook.com
Don't make CondstoreFolderSyncEngine.idle_wait method private.

Forgot that prefixing with __ mangles the name so that it can't be used by the
GmailFolderSyncEngine derived class.
[oauth/errors] Properly coerce unicode strings.

Summary: Fixes T440

Test Plan: regression

Reviewers: emfree

Reviewed By: emfree

Maniphest Tasks: T440

Differential Revision: https://review.inboxapp.com/D464
Don't return all namespaces if email_address=None for the test client.
Filter ImapThread by namespace in generic Imap threading algorithm.
Filter ImapThread by namespace in generic Imap actions code too.
[events] Don't sync events on icloud for now as user receives an email about account being accessed from the web.
Remove reference to deprecated order_by parameter in docs.

Also fix example start parameter in delta sync docs.
Namespace filtering in events.crud
Store original message if quote-stripping removes everything.

Summary:
False positives in quote detection can sometimes remove everything, leaving a
blank message.  In this case, we now store the un-stripped message instead.
This is far from a perfect heuristic, but better than nothing.

Test Plan:
Run Message.calculate_sanitized_body on messages both where quote
detection works correctly and where it would strip the whole message. Run a
sync as a sanity check.

Reviewers: mg

Reviewed By: mg

Differential Revision: https://review.inboxapp.com/D463
[Schema] Fix typo in account type polymorphism for Outlook accounts.

Summary: Do not want to get bit by this again.

Test Plan: Run migration on a database with Outlook accounts.

Reviewers: kav-ya

Reviewed By: kav-ya

Differential Revision: https://review.inboxapp.com/D467
[DEPENDENCIES] Require msgpack-python.

We were previously implicitly installing msgpack via ZeroRPC, so removing the
ZeroRPC dependency broke fresh installs.