Socket
Socket
Sign inDemoInstall

smtp-connection

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

smtp-connection - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

src/data-stream.js

2

Gruntfile.js

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc