smtp-connection
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -18,3 +18,3 @@ module.exports = function(grunt) { | ||
}, | ||
src: ['test/*-unit.js'] | ||
src: ['test/*-test.js'] | ||
} | ||
@@ -21,0 +21,0 @@ } |
{ | ||
"name": "smtp-connection", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "Connect to SMTP servers", | ||
"main": "lib/smtp-connection.js", | ||
"main": "src/smtp-connection.js", | ||
"directories": { | ||
@@ -30,5 +30,6 @@ "test": "test" | ||
"grunt-mocha-test": "~0.10.0", | ||
"simplesmtp": "^0.3.32", | ||
"sinon": "^1.9.0", | ||
"simplesmtp": "^0.3.32" | ||
"xoauth2": "^0.1.8" | ||
} | ||
} |
@@ -73,6 +73,30 @@ # smtp-connection | ||
* **auth.pass** is the password for the user | ||
* **auth.xoauth2** is the OAuth2 access token (preferred if both `pass` and `xoauth2` values are set) | ||
* **auth.xoauth2** is the OAuth2 access token (preferred if both `pass` and `xoauth2` values are set) or an [XOAuth2](https://github.com/andris9/xoauth2) token generator object. | ||
* **callback** is the callback to run once the authentication is finished. Callback has the following arugments | ||
* **err** and error object if authentication failed | ||
If a [XOAuth2](https://github.com/andris9/xoauth2) token generator is used as the value for `auth.xoauth2` then you do not need to set `auth.user`. XOAuth2 generator generates required accessToken itself if it is missing or expired. In this case if the authentication fails, a new token is requeested and the authentication is retried. If it still fails, an error is returned. | ||
**XOAuth2 Example** | ||
```javascript | ||
var generator = require('xoauth2').createXOAuth2Generator({ | ||
user: '{username}', | ||
clientId: '{Client ID}', | ||
clientSecret: '{Client Secret}', | ||
refreshToken: '{refresh-token}' | ||
}); | ||
// listen for token updates | ||
// you probably want to store these to a db | ||
generator.on('token', function(token){ | ||
console.log('New token for %s: %s', token.user, token.accessToken); | ||
}); | ||
// login | ||
connection.login({ | ||
xoauth2: generator | ||
}, callback); | ||
``` | ||
### send | ||
@@ -79,0 +103,0 @@ |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
38341
921
143
7
3