coddingtonbear/django-mailbox — pull request #17 by alexlovelltroy (2014-05-27 19:36:48+00:00)
Title: Adding support for gmail inboxes with oauth2 authentication

Gmail's IMAP offers revokable oauth2 authentication which is more secure. It grabs the username from the uri and attempts to find a python-social-auth user for connection; the password is ignored and can be safely blanked. If that fails, it can fall back to normal IMAP authentication with the password.

I implemented it on top of the python-social-auth oauth2 flow rather than rolling my own, but it doesn't become a dependency if you don't use the new oauth2 flow because it is only imported as needed specifically for gmail mailbox types.