mail-in-a-box/mailinabox — pull request #279 by JoshData (2014-11-30 17:40:54+00:00)
Title: Two-factor authentication / 2FA / TOTP

This branch is for implementing advanced authentication mechanisms.

Currently all authentication (imap, smtp, webmail, etc.) is done through Dovecot's auth process, which is configured to query our user database for a hashed password.

This PR replaces Dovecot's auth mechanism with a query to the Mail-in-a-Box management daemon. The management daemon then checks the user's password.

* This PR doesn't currently do anything except move password checking into the management daemon. The management daemon checks the password against the user database in a Dovecot-compatible way (in fact, using Dovecot).
* The next step is to add additional authentication mechanisms into the management daemon [here](https://github.com/mail-in-a-box/mailinabox/blob/otp/management/auth.py#L108), such as:
* TOTP one-time passwords / 2FA using [python-oath](https://github.com/bdauvergne/python-oath)
* App-specific passwords (i.e. additional plain passwords with descriptive labels that can be easily revoked)

cc @vzvenyach @konklone