Remove deprecated "message_id" field from Block representation.

Also update docs.
Strip all stack locals from Sentry exception messages.

Summary:
Having them is nice for debugging, but per discussion with @dlitz there's just
too much potential to leak information.

Test Plan: Unit test added.

Reviewers: dlitz

Reviewed By: dlitz

Subscribers: dlitz

Differential Revision: https://review.inboxapp.com/D487
Properly limit query for existing calendar object by account.
[sendmail/client] Better error handling / logging when errors occur while trying to send mail.~

Summary:
OAuthError bubbles up to top if we can't login to the account during
sendmail. Instead, catch that exception and turn it into a generic sendmail
exception with proper logging. Note: exception still bubbles up to top, need
more generic way of handling these issues (i.e. keep retrying and/or eventually
fail), however that needs to be done across all actions.

Fixes T479

Test Plan: review code / regression

Reviewers: emfree

Reviewed By: emfree

Maniphest Tasks: T479

Differential Revision: https://review.inboxapp.com/D501
[actions] Filter actions to limit them the sync-host that the account is syncing on.

Summary:
Forces the syncback service to only perform actions for which the account is associated with the same machine.

There are a few other changes that need to be made before we can have
multi-machine mailsync (none of which seem to be very significant), however
this one at the least is straightforward.

Test Plan: regression + system tests

Reviewers: emfree

Reviewed By: emfree

Differential Revision: https://review.inboxapp.com/D503
[syncback] Fix tests to work with sync_host filtering in syncback_service (?).
Defer initialization of Crispin connection pool so that it can be retried.

CrispinConnectionPool.__init__ calls CrispinConnectionPool._set_account_info(),
which does auth and related stuff. We were calling this in the FolderSyncEngine
constructor, which meant that the folder sync would just silently die if some
sort of error occurred. Not good.

In general we really shouldn't be doing this sort of work in any class
constructors at all.
[sync/missing folders] Create folders on the backend when not present. Required for hovermail.

Summary:
Providers don't always provide all of the folders that we are
expecting. One such provider is hovermail. In order to support such providers,
we need to create these folders on-demand. This may not be the best place to do
so, however I couldn't think of a better place (perhaps initial sync?).

Fixes T446

Test Plan: sync hovermail account, perform self-send test.

Reviewers: emfree

Reviewed By: emfree

Maniphest Tasks: T446

Differential Revision: https://review.inboxapp.com/D506
Fix typos when removing uids from download stack in IMAP sync.

This wasn't actually breaking anything, because we'd just end up trying to
download a UID that wasn't there. But still.
Bound thread length when doing custom threading.

Summary:
This should fix the recursion depth exceeded error we keep seeing. It's also
probably not a good idea to let threads get super long anyways.

Fixes T434.

Test Plan: Unit test added.

Reviewers: khamidou

Reviewed By: khamidou

Maniphest Tasks: T434

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

Conflicts:
	inbox/mailsync/backends/imap/generic.py
	tests/general/test_thread_creation.py
Deletes messages which aren't associated to an UID.

Summary: Fixes T464.

Test Plan: Synced an account, created a draft. Sent it and checked that the draft wasn't there anymore.

Reviewers: emfree

Reviewed By: emfree

Subscribers: mg

Maniphest Tasks: T464

Differential Revision: https://review.inboxapp.com/D491
broke the build -- it's not possible to modify a list and iterate it at
the same time with SQLAlchemy
Fix TypeError in cleanup_subject() when subjecct is None.
Remove no-longer-valid test.