Vagabond/gen_smtp — pull request #76 by benbro (2014-12-31 23:15:33+00:00)
Title: Add support for XOAUTH2 client authentication

Authenticating to gmail using oauth2 access token:
https://developers.google.com/gmail/xoauth2_protocol

Generate oauth2 access token:
1. Register an application in [Google APIs Console](https://code.google.com/apis/console/).
2. Create and authorize an auth token using [oauth2.py](https://code.google.com/p/google-mail-oauth2-tools/wiki/OAuth2DotPyRunThrough).
3. Refresh the auth token every 60 minutes using [oauth2.py](https://code.google.com/p/google-mail-oauth2-tools/wiki/OAuth2DotPyRunThrough).

The XOAUTH2 string:
auth_string = base64("user=" {User} "^Aauth=Bearer " {Access Token} "^A^A")

The SMTP auth:
AUTH XOAUTH2 {auth_string}