[docs] Improving heading text layout
Fix filtering criterion when updating contacts from message.
Clearer logging of token validation errors and unparseable cal events.
Raise ValidationError in events code, don't return it.
Raise ConnectionError rather than ValidationError for all non-Invalid Credentials errors during Oauth.
Fix MX domain validation 'bug'

Summary: I spent an hour on this quasi-bug... *sigh* The problem is the MX domain validation code expects domain names to end with a '.' (because this is how they are represented in DNS). I changed the code to validate against standard domain names.

Test Plan: Ran a sync on gandi.

Reviewers: charles

Reviewed By: charles

Differential Revision: https://review.inboxapp.com/D318
[docs] Fix a few minor issues with calendar docs.
Fix monocle/app.py code merge error
Set pool_recycle to deal with MySQL closing idle connections.

See http://docs.sqlalchemy.org/en/latest/dialects/mysql.html#connection-timeouts
Manage multiprocessing via supervisor, not startup script.

Summary:
An issue with our current setup is that if a single sync process gets taken
out, say by the OOM killer, it will not be revived until the entire process
group is restarted. As far as I can tell, there are two solutions to this:
 * Loop and poll child process health.
 * Use supervisor to explicitly manage a group of processes.
This commit implements the latter alternative, if used with the following
supervisor config.

```
[program:mailsync]
numprocs=8
environment=MAILSYNC_PROCESSES=8
process_name=%(process_num)d
command=/srv/inbox/bin/inbox-start --prod --process_num=%(process_num)
directory=/srv/inbox
user=admin
autostart=true
autorestart=true
stopasgroup=true
stdout_logfile=/var/log/inboxapp/mailsync.log
stderr_logfile=/var/log/inboxapp/mailsync.err.log
 ```

Test Plan:
Run mailsync with this config and introduce a memory leak in a
single process.

Reviewers: spang

Reviewed By: spang

Differential Revision: https://review.inboxapp.com/D322
Fix gandi folder mapping.

Summary: Folder mapping was incomplete for Gandi. Fixes T283.

Test Plan: Ran a full sync. Saw that all canonical folders were indexed.

Reviewers: charles, spang

Reviewed By: spang

Subscribers: spang

Maniphest Tasks: T283

Differential Revision: https://review.inboxapp.com/D320
Break into a python interpreter from anywhere

Summary:
I use pdb a lot when debugging and I find it really annoying that we only get stack traces from errors on gunks. Wouldn't it be cool to be able to at least have access to an interpreter at the bottom of a stack trace? Well, rdb does this. To use it, insert a call to "rdb.break_to_interpreter" and the greenlet will block while waiting for a telnet (or netcat if you can) connection on localhost (and without blocking the whole process).

Currently the debugger is very basic - it's still possible to examine the stackframe using sys._getframe, though. I'm looking for a way to make the frame data available in locals() and to have greenlets break into the debugger whenever they get an uncaught exception.

Test Plan: Ran a sync

Reviewers: charles, spang, emfree

Reviewed By: emfree

Projects: #inbox-sync

Differential Revision: https://review.inboxapp.com/D321
fix var scoping bug
Require refresh token when committing OAuth accounts.

Don't know how this could happen, but in the immediate future failing with a
KeyError seems better than silently committing a null value.
Docs: remove invalid key from "update thread" example

The thread PUT route is only able to have the keys "add_tags" and "remove_tags" in the request
body, otherwise the response is a 400.
Merge pull request #77 from caitp/docs

Docs: remove invalid key from "update thread" example
[gmail/auth] Only set the refresh_token if we get one.

Summary: We had an issue where a re-auth'd account would clear out an existing refresh token.

Test Plan: Read the code.

Reviewers: emfree

Reviewed By: emfree

Differential Revision: https://review.inboxapp.com/D323
[events] Make event summaries longer, truncate if longer than new length.

Summary:
We previously hit an error when an event subject was too long. Make this column longer and truncate event summaries if they are longer than that.

Fixes T296

Test Plan: Review code.

Reviewers: emfree

Reviewed By: emfree

Maniphest Tasks: T296

Differential Revision: https://review.inboxapp.com/D325
[events/google] Handle malformed events that don't have dates.
Don't overwrite Account.sync_state at sync_stop() if Invalid credentials/Connection error/
Killed because foldersyncs were killed.