Socket
Socket
Sign inDemoInstall

smtp-server

Package Overview
Dependencies
2
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.1 to 2.0.2

4

CHANGELOG.md
# Changelog
## v2.0.2 2017-02-17
* Fixad a bug where `server.onConnect(err)` did not close the connection
## v2.0.1 2017-02-04

@@ -4,0 +8,0 @@

24

lib/sasl.js

@@ -101,3 +101,3 @@ 'use strict';

user: username
}, '[%s] Authentication error for %s using %s. %s', this._id, username, 'PLAIN', err.message);
}, 'Authentication error for %s using %s. %s', username, 'PLAIN', err.message);
this.send(err.responseCode || 535, err.message);

@@ -113,3 +113,3 @@ return callback();

user: username
}, '[%s] Authentication failed for %s using %s', this._id, username, 'PLAIN');
}, 'Authentication failed for %s using %s', username, 'PLAIN');
this.send(response.responseCode || 535, response.message || 'Error: Authentication credentials invalid');

@@ -124,3 +124,3 @@ return callback();

user: username
}, '[%s] %s authenticated using %s', this._id, username, 'PLAIN');
}, '%s authenticated using %s', username, 'PLAIN');
this.session.user = response.user;

@@ -178,3 +178,3 @@ this.session.transmissionType = this._transmissionType();

user: username
}, '[%s] Authentication error for %s using %s. %s', this._id, username, 'LOGIN', err.message);
}, 'Authentication error for %s using %s. %s', username, 'LOGIN', err.message);
this.send(err.responseCode || 535, err.message);

@@ -190,3 +190,3 @@ return callback();

user: username
}, '[%s] Authentication failed for %s using %s', this._id, username, 'LOGIN');
}, 'Authentication failed for %s using %s', username, 'LOGIN');
this.send(response.responseCode || 535, response.message || 'Error: Authentication credentials invalid');

@@ -201,3 +201,3 @@ return callback();

user: username
}, '[%s] %s authenticated using %s', this._id, username, 'LOGIN');
}, '%s authenticated using %s', username, 'LOGIN');
this.session.user = response.user;

@@ -257,3 +257,3 @@ this.session.transmissionType = this._transmissionType();

user: username
}, '[%s] Authentication error for %s using %s. %s', this._id, username, 'XOAUTH2', err.message);
}, 'Authentication error for %s using %s. %s', username, 'XOAUTH2', err.message);
this.send(err.responseCode || 535, err.message);

@@ -269,3 +269,3 @@ return callback();

user: username
}, '[%s] Authentication failed for %s using %s', this._id, username, 'XOAUTH2');
}, 'Authentication failed for %s using %s', username, 'XOAUTH2');
this._nextHandler = SASL.XOAUTH2_error.bind(this);

@@ -281,3 +281,3 @@ this.send(response.responseCode || 334, new Buffer(JSON.stringify(response.data || {})).toString('base64'));

user: username
}, '[%s] %s authenticated using %s', this._id, username, 'XOAUTH2');
}, '%s authenticated using %s', username, 'XOAUTH2');
this.session.user = response.user;

@@ -325,3 +325,3 @@ this.session.transmissionType = this._transmissionType();

user: username
}, '[%s] Authentication error for %s using %s. %s', this._id, username, 'CRAM-MD5', err.message);
}, 'Authentication error for %s using %s. %s', username, 'CRAM-MD5', err.message);
this.send(err.responseCode || 535, err.message);

@@ -337,3 +337,3 @@ return callback();

user: username
}, '[%s] Authentication failed for %s using %s', this._id, username, 'CRAM-MD5');
}, 'Authentication failed for %s using %s', username, 'CRAM-MD5');
this.send(response.responseCode || 535, response.message || 'Error: Authentication credentials invalid');

@@ -348,3 +348,3 @@ return callback();

user: username
}, '[%s] %s authenticated using %s', this._id, username, 'CRAM-MD5');
}, '%s authenticated using %s', username, 'CRAM-MD5');
this.session.user = response.user;

@@ -351,0 +351,0 @@ this.session.transmissionType = this._transmissionType();

@@ -140,4 +140,12 @@ 'use strict';

this._server.onConnect(this.session, err => {
this._server.logger.info({
tnx: 'connection',
cid: this._id,
host: this.remoteAddress,
hostname: this.clientHostname
}, 'Connection from %s', this.clientHostname);
if (err) {
this.send(err.responseCode || 554, err.message);
return this.close();
}

@@ -151,10 +159,4 @@

this._server.logger.info({
tnx: 'connection',
cid: this._id,
host: this.remoteAddress,
hostname: this.clientHostname
}, '[%s] Connection from %s', this._id, this.clientHostname);
this.send(220, this.name + ' ' + (this._server.options.lmtp ? 'LMTP' : 'ESMTP') + (this._server.options.banner ? ' ' + this._server.options.banner : ''));
this.send(220, this.name + ' ' + (this._server.options.lmtp ? 'LMTP' : 'ESMTP') + (this._server.options.banner ? ' ' + this._server.options.banner : ''));
if (typeof next === 'function') {

@@ -201,3 +203,3 @@ next();

user: this.session.user && this.session.user.username
}, '[%s] S:', this._id, payload);
}, 'S:', payload);
}

@@ -265,3 +267,3 @@

user: this.session.user && this.session.user.username
}, '[%s] Connection closed to %s', this._id, this.clientHostname || this.remoteAddress);
}, 'Connection closed to %s', this.clientHostname || this.remoteAddress);
setImmediate(() => this._server.onClose(this.session));

@@ -289,3 +291,3 @@ }

user: this.session.user && this.session.user.username
}, '[%s]', this._id, err);
}, '%s', err.message);
this.emit('error', err);

@@ -316,3 +318,3 @@ }

user: this.session.user && this.session.user.username
}, '[%s] C:', this._id, (command || '').toString());
}, 'C:', (command || '').toString());

@@ -338,3 +340,3 @@ let handler;

user: this.session.user && this.session.user.username
}, '[%s] PROXY from %s through %s', this._id, params[1].trim().toLowerCase(), this.remoteAddress);
}, 'PROXY from %s through %s', params[1].trim().toLowerCase(), this.remoteAddress);
this.remoteAddress = params[1].trim().toLowerCase();

@@ -738,3 +740,3 @@ if (params[3]) {

user: this.session.user && this.session.user.username
}, '[%s] User deauthenticated using %s', this._id, 'XCLIENT');
}, 'User deauthenticated using %s', 'XCLIENT');
this.session.user = false;

@@ -747,3 +749,3 @@ }

user: value
}, '[%s] %s authenticated using %s', this._id, value, 'XCLIENT');
}, '%s authenticated using %s', value, 'XCLIENT');

@@ -774,3 +776,3 @@ this.session.user = {

user: this.session.user && this.session.user.username
}, '[%s] XCLIENT from %s through %s', this._id, value, this.remoteAddress);
}, 'XCLIENT from %s through %s', value, this.remoteAddress);

@@ -794,3 +796,3 @@ // store original value for reference as ADDR:DEFAULT

user: this.session.user && this.session.user.username
}, '[%s] XCLIENT hostname resolved as "%s"', this._id, value);
}, 'XCLIENT hostname resolved as "%s"', value);

@@ -812,3 +814,3 @@ // store original value for reference as NAME:DEFAULT

user: this.session.user && this.session.user.username
}, '[%s] XCLIENT remote port resolved as "%s"', this._id, value);
}, 'XCLIENT remote port resolved as "%s"', value);

@@ -916,3 +918,3 @@ // store original value for reference as NAME:DEFAULT

user: this.session.user && this.session.user.username
}, '[%s] XFORWARD from %s through %s', this._id, value, this.remoteAddress);
}, 'XFORWARD from %s through %s', value, this.remoteAddress);

@@ -936,3 +938,3 @@ // store original value for reference as ADDR:DEFAULT

user: this.session.user && this.session.user.username
}, '[%s] XFORWARD hostname resolved as "%s"', this._id, value);
}, 'XFORWARD hostname resolved as "%s"', value);
this.clientHostname = value.toLowerCase();

@@ -948,3 +950,3 @@ break;

user: this.session.user && this.session.user.username
}, '[%s] XFORWARD port resolved as "%s"', this._id, value);
}, 'XFORWARD port resolved as "%s"', value);
this.remotePort = value;

@@ -960,3 +962,3 @@ break;

user: this.session.user && this.session.user.username
}, '[%s] XFORWARD HELO name resolved as "%s"', this._id, value);
}, 'XFORWARD HELO name resolved as "%s"', value);
this.hostNameAppearsAs = value;

@@ -1031,8 +1033,9 @@ break;

this.session.tlsOptions = this.tlsOptions = this._socket.getCipher();
let cipher = this.session.tlsOptions && this.session.tlsOptions.name;
this._server.logger.info({
tnx: 'starttls',
cid: this._id,
user: this.session.user && this.session.user.username
}, '[%s] Connection upgraded to TLS', this._id);
user: this.session.user && this.session.user.username,
cipher
}, 'Connection upgraded to TLS using ', cipher || 'N/A');
this._socket.pipe(this._parser);

@@ -1175,3 +1178,3 @@ });

user: this.session.user && this.session.user.username
}, '[%s] C: <%s bytes of DATA>', this._id, this._parser.dataBytes);
}, 'C: <%s bytes of DATA>', this._parser.dataBytes);

@@ -1268,3 +1271,3 @@ if ((typeof this._dataStream === 'object') && (this._dataStream) && (this._dataStream.readable)) {

user: this.session.user && this.session.user.username
}, '[%s] Client tried to invoke SHELL', this._id);
}, 'Client tried to invoke SHELL');

@@ -1288,3 +1291,3 @@ if (!this.session.isWizard) {

user: this.session.user && this.session.user.username
}, '[%s] Client tried to invoke KILL', this._id);
}, 'Client tried to invoke KILL');

@@ -1291,0 +1294,0 @@ this.send(500, 'Can\'t kill Mom');

{
"name": "smtp-server",
"version": "2.0.1",
"version": "2.0.2",
"description": "Create custom SMTP servers on the fly",

@@ -13,3 +13,3 @@ "main": "lib/smtp-server.js",

"ipv6-normalize": "^1.0.1",
"nodemailer": "^3.0.2"
"nodemailer": "^3.1.1"
},

@@ -16,0 +16,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc