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

nodemailer-smtp-pool

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodemailer-smtp-pool - npm Package Compare versions

Comparing version 1.1.6 to 1.2.0

4

package.json
{
"name": "nodemailer-smtp-pool",
"version": "1.1.6",
"version": "1.2.0",
"description": "SMTP transport for Nodemailer",

@@ -26,3 +26,3 @@ "main": "src/smtp-pool.js",

"nodemailer-wellknown": "^0.1.7",
"smtp-connection": "^1.3.3"
"smtp-connection": "^1.3.7"
},

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

@@ -44,2 +44,4 @@ # SMTP transport module for Nodemailer

Alternatively you can use connection url with protocol 'smtp:' or 'smtps:'. Use query arguments for additional configuration values.
Pooled SMTP transport uses the same options as [SMTP transport](https://github.com/andris9/nodemailer-smtp-transport) with the addition of **maxConnections** and **maxMessages**.

@@ -66,2 +68,10 @@

Or with connection url (gmail)
```javascript
var transporter = nodemailer.createTransport(
smtpTransport('smtps://username%40gmail.com:password@smtp.gmail.com')
);
```
## Authentication

@@ -68,0 +78,0 @@

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

var util = require('util');
var urllib = require('url');

@@ -28,5 +29,9 @@ // expose to the world

if (options && typeof options === 'string') {
options = {
url: options
};
}
this.options = options && clone(options) || {};
this.options.maxConnections = this.options.maxConnections || 5;
this.options.maxMessages = this.options.maxMessages || 100;

@@ -41,2 +46,39 @@ if (this.options.service && (hostData = wellknown(this.options.service))) {

// parse a configuration URL into configuration options
if (this.options.url) {
[urllib.parse(this.options.url, true)].forEach(function (url) {
var auth;
this.options.secure = url.protocol === 'smtps:';
if (!isNaN(url.port) && Number(url.port)) {
this.options.port = Number(url.port);
}
if (url.hostname) {
this.options.host = url.hostname;
}
if (url.auth) {
auth = url.auth.split(':');
if (!this.options.auth) {
this.options.auth = {};
}
this.options.auth.user = decodeURIComponent(auth[0]);
this.options.auth.pass = decodeURIComponent(auth[1]);
}
Object.keys(url.query || {}).forEach(function (key) {
if (!(key in this.options)) {
this.options[key] = url.query[key];
}
}.bind(this));
}.bind(this));
}
this.options.maxConnections = this.options.maxConnections || 5;
this.options.maxMessages = this.options.maxMessages || 100;
// temporary object

@@ -43,0 +85,0 @@ var connection = new SMTPConnection(this.options);

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