smtp-connection
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -211,3 +211,3 @@ 'use strict'; | ||
var authMethod; | ||
if (this._auth._xoauth2 && this._supportedAuth.indexOf('XOAUTH2') >= 0) { | ||
if (this._auth.xoauth2 && this._supportedAuth.indexOf('XOAUTH2') >= 0) { | ||
authMethod = 'XOAUTH2'; | ||
@@ -226,3 +226,3 @@ } else if (this.options.authMethod) { | ||
}.bind(this); | ||
this._sendCommand('AUTH XOAUTH2 ' + this._buildXOAuth2Token(this._auth.user, this._auth._xoauth2)); | ||
this._sendCommand('AUTH XOAUTH2 ' + this._buildXOAuth2Token(this._auth.user, this._auth.xoauth2)); | ||
return; | ||
@@ -243,3 +243,3 @@ case 'LOGIN': | ||
this._auth.user + '\u0000' + | ||
this._auth.password, 'utf-8').toString('base64')); | ||
this._auth.pass, 'utf-8').toString('base64')); | ||
return; | ||
@@ -626,7 +626,2 @@ case 'CRAM-MD5': | ||
// Detect if the server supports XOAUTH auth | ||
if (str.match(/AUTH(?:(\s+|=)[^\n]*\s+|\s+|=)XOAUTH/i)) { | ||
this._supportedAuth.push('XOAUTH'); | ||
} | ||
// Detect if the server supports XOAUTH2 auth | ||
@@ -739,3 +734,3 @@ if (str.match(/AUTH(?:(\s+|=)[^\n]*\s+|\s+|=)XOAUTH2/i)) { | ||
var base64decoded = new Buffer(challengeString, 'base64').toString('ascii'), | ||
hmac_md5 = crypto.createHmac('md5', this._auth.password); | ||
hmac_md5 = crypto.createHmac('md5', this._auth.pass); | ||
@@ -791,3 +786,3 @@ hmac_md5.update(base64decoded); | ||
this._sendCommand(new Buffer(this._auth.password + '', 'utf-8').toString('base64')); | ||
this._sendCommand(new Buffer(this._auth.pass + '', 'utf-8').toString('base64')); | ||
}; | ||
@@ -803,3 +798,3 @@ | ||
SMTPConnection.prototype._actionAUTHComplete = function(str, callback) { | ||
if (this._xoauth2 && str.substr(0, 3) === '334') { | ||
if (str.substr(0, 3) === '334') { | ||
this._currentAction = function(response) { | ||
@@ -806,0 +801,0 @@ this._actionAUTHComplete(response, callback); |
{ | ||
"name": "smtp-connection", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Connect to SMTP servers", | ||
@@ -5,0 +5,0 @@ "main": "lib/smtp-connection.js", |
@@ -72,4 +72,4 @@ # smtp-connection | ||
* **auth.user** is the username | ||
* **auth.password** is the password for the user | ||
* **auth.xoauth2** is the OAuth2 access token (preferred if both `password` and `xoauth2` values are set) | ||
* **auth.pass** is the password for the user | ||
* **auth.xoauth2** is the OAuth2 access token (preferred if both `pass` and `xoauth2` values are set) | ||
* **callback** is the callback to run once the authentication is finished. Callback has the following arugments | ||
@@ -76,0 +76,0 @@ * **err** and error object if authentication failed |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35785
906