Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.0.0-beta.0 to 2.0.0-beta.1

5

CHANGELOG.md
# Changelog
## v2.0.0-beta.1 2016-01-01
* Re-added `debug` option. If set to true, then logs SMTP traffic, otherwise only transaction events
* Pass streamed message content to the logger
## v2.0.0-beta.0 2016-01-01

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

27

lib/smtp-connection.js

@@ -11,2 +11,3 @@ 'use strict';

var DataStream = require('./data-stream');
var PassThrough = require('stream').PassThrough;

@@ -32,2 +33,3 @@ module.exports = SMTPConnection;

* * **logger** - bunyan compatible logger interface
* * **debug** - if true pass SMTP traffic to the logger
* * **tls** - options for createCredentials

@@ -530,3 +532,5 @@ * * **socket** - existing socket to use instead of creating a new one (see: http://nodejs.org/api/net.html#net_class_net_socket)

this.logger.debug('S: %s', str.trim());
if (this.options.debug) {
this.logger.debug('S: %s', str.trim());
}

@@ -563,3 +567,5 @@ if (!str.trim()) { // skip unexpected empty lines

this.logger.debug('C: %s', (str || '').toString().trim());
if (this.options.debug) {
this.logger.debug('C: %s', (str || '').toString().trim());
}

@@ -613,2 +619,3 @@ this._socket.write(new Buffer(str + '\r\n', 'utf-8'));

var dataStream = new DataStream();
var logStream;

@@ -623,8 +630,12 @@ this._currentAction = function (str) {

dataStream.on('readable', function () {
var chunk;
while ((chunk = dataStream.read())) {
this.logger.debug('C: %s', chunk.toString('binary').trim());
}
}.bind(this));
if (this.options.debug) {
logStream = new PassThrough();
logStream.on('readable', function () {
var chunk;
while ((chunk = logStream.read())) {
this.logger.debug('C: %s', chunk.toString('binary').trim());
}
}.bind(this));
dataStream.pipe(logStream);
}

@@ -631,0 +642,0 @@ return dataStream;

{
"name": "smtp-connection",
"version": "2.0.0-beta.0",
"version": "2.0.0-beta.1",
"description": "Connect to SMTP servers",

@@ -5,0 +5,0 @@ "main": "lib/smtp-connection.js",

@@ -40,2 +40,3 @@ # smtp-connection

* **options.logger** optional [bunyan](https://github.com/trentm/node-bunyan) compatible logger instance. By default logs to console. If set to `false` then nothing is logged
* **options.debug** if set to true, then log SMTP traffic, otherwise log only transaction events
* **options.lmtp** if true, uses LMTP instead of SMTP to talk to the server. Partial support, does not work well with multiple recipients

@@ -42,0 +43,0 @@ * **options.authMethod** defines preferred authentication method, e.g. 'PLAIN'

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