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 2.8.0 to 2.9.0

5

CHANGELOG.md
# Changelog
## v2.9.0 2016-07-13
* Added `reset(cb)` method to call `RSET` command
* Include failed recipients in the response error object
## v2.8.0 2016-07-07

@@ -4,0 +9,0 @@

27

lib/smtp-connection.js

@@ -121,2 +121,8 @@ 'use strict';

/**
* Includes current envelope (from, to)
* @private
*/
this._envelope = false;
/**
* Lists supported extensions

@@ -387,2 +393,18 @@ * @private

/**
* Resets connection state
*
* @param {Function} callback Callback to return once connection is reset
*/
SMTPConnection.prototype.reset = function (callback) {
this._sendCommand('RSET');
this._responseActions.push(function (str) {
if (str.charAt(0) !== '2') {
return callback(this._formatError('Could not reset session state:\n' + str, 'EPROTOCOL', str, 'RSET'));
}
this._envelope = false;
return callback(null, true);
}.bind(this));
};
/**
* Connection listener that is run when the connection to

@@ -1261,3 +1283,6 @@ * the server is opened

} else {
return callback(this._formatError('Can\'t send mail - all recipients were rejected', 'EENVELOPE', str, 'RCPT TO'));
err = this._formatError('Can\'t send mail - all recipients were rejected', 'EENVELOPE', str, 'RCPT TO');
err.rejected = this._envelope.rejected;
err.rejectedErrors = this._envelope.rejectedErrors;
return callback(err);
}

@@ -1264,0 +1289,0 @@ } else if (this._envelope.rcptQueue.length) {

4

package.json
{
"name": "smtp-connection",
"version": "2.8.0",
"version": "2.9.0",
"description": "Connect to SMTP servers",

@@ -34,3 +34,3 @@ "main": "lib/smtp-connection.js",

"sinon": "^1.17.4",
"smtp-server": "^1.11.0",
"smtp-server": "^1.11.1",
"xoauth2": "^1.1.0"

@@ -37,0 +37,0 @@ },

@@ -34,3 +34,3 @@ # smtp-connection

* **options.requireTLS** forces the client to use STARTTLS. Returns an error if upgrading the connection is not possible or fails.
* **options.lmtp** if true, uses LMTP instead of SMTP to talk to the server
* **options.name** optional hostname of the client, used for identifying to the server

@@ -176,4 +176,12 @@ * **options.localAddress** is the local interface to bind to for network connections

### reset
Use it to reset current session (invokes RSET command)
```javascript
connection.reset(callback);
```
## License
**MIT**
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