mozilla/fxa-customs-server — pull request #70 by rfk (2014-10-10 05:45:49+00:00)
Title: Block all actions for emails that are explicitly banned

The `email_record.update` function is the final arbiter of whether an email address gets blocked from performing an action. It currently short-circuits to allow any non-email-sending action through regardless of the state of the record.

This doesn't work well for explicit bans of email addresses (as might be generated through our SQS ban queue) which AFAICT should cause *all* actions with that email address to be blocked. For example, if I send a message to ban a particular email, I would expect to be blocked from logging in with that email despite it being a non-email-sending action.

This PR refactors the logic to distinguish these two cases of "blocked" and "banned".

@fmarier can you please sanity-check the behaviour here, and @chilts to r? since it's a good excuse to dig into this codebase.