moneyapi / google-api-python-client

Automatically exported from code.google.com/p/google-api-python-client
Other
0 stars 0 forks source link

Add Support for IMAP + SMTP #214

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hello,

Recently, Google announced xoauth2 support for IMAP and SMTP.  I've written a 
fairly lightweight library that utilizes oauth2client's credentials objects to 
handle access_token fetching and management.  This should allow folks to 
connect to IMAP/SMTP and utilize the OAuth2WebServer flows -- and more 
importantly the Service Account/JWT handling present in oauth2client.

It's a bit outside the boundary here, but it might be worthy for an include 
into google-api-python-client
https://github.com/richieforeman/oauth2gmail

Thanks,
Richie Foreman

Original issue reported on code.google.com by richie.f...@gmail.com on 6 Nov 2012 at 7:06

GoogleCodeExporter commented 8 years ago
Not exactly sure this would be a good addition to the library, wouldn't it have 
to be specific to each SMTP library?

Regardless I have some comments on the code:

https://github.com/richieforeman/oauth2gmail/blob/master/oauth2gmail.py#L21

Credentials objects don't need an authorized httplib2.Http() instance to do a 
refresh.

https://github.com/richieforeman/oauth2gmail/blob/master/oauth2gmail.py#L26

Don't catch all exceptions, pick a specific set, or at least StandardError.

Original comment by jcgregorio@google.com on 6 Nov 2012 at 3:39

GoogleCodeExporter commented 8 years ago

Original comment by jcgregorio@google.com on 16 Nov 2012 at 1:43