smtp-connection
Advanced tools
Comparing version 2.8.0 to 2.9.0
# 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 @@ |
@@ -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) { |
{ | ||
"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** |
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
65554
1386
186