mscdex/node-imap — pull request #176 by mikemee (2013-03-07 06:04:50+00:00)
Title: Add Gmail oauth support

Tweaks and incorporates https://github.com/andris9/inbox/blob/master/lib/xoauth.js by adding a new ImapConnection property xoauthGmail. If xoauth hasn't already been provided and xoauthGmail is, then it calculates the correct value and sets xoauth.

A very basic test is included to validate the interaction behaviour and to sanity check that the resulting value is a reasonable length. The documentation is also updated. I'll provide an example near the top too if this pull request is accepted.

This version is only tested for 2-legged auth.

In theory it will work with 3-logged auth when a token and token secret is provided and similar examples at https://github.com/andris9/inbox, however I have not tested that. xoauth2 is not hooked up at all and probably should be.