nodemailer
Advanced tools
Comparing version 6.7.6 to 6.7.7
# CHANGELOG | ||
## 6.7.7 2022-07-06 | ||
- Resolver fixes | ||
## 6.7.5 2022-05-04 | ||
@@ -4,0 +8,0 @@ |
@@ -6,3 +6,2 @@ /* eslint no-undefined: 0, prefer-spread: 0, no-control-regex: 0 */ | ||
const crypto = require('crypto'); | ||
const os = require('os'); | ||
const fs = require('fs'); | ||
@@ -1286,3 +1285,3 @@ const punycode = require('punycode'); | ||
// try to use the domain of the FROM address or fallback to server hostname | ||
(this.getEnvelope().from || this.hostname || os.hostname() || 'localhost').split('@').pop() + | ||
(this.getEnvelope().from || this.hostname || 'localhost').split('@').pop() + | ||
'>' | ||
@@ -1289,0 +1288,0 @@ ); |
@@ -15,5 +15,18 @@ /* eslint no-console: 0 */ | ||
const networkInterfaces = (module.exports.networkInterfaces = os.networkInterfaces()); | ||
let networkInterfaces; | ||
try { | ||
networkInterfaces = os.networkInterfaces(); | ||
} catch (err) { | ||
// fails on some systems | ||
} | ||
const isFamilySupported = family => { | ||
module.exports.networkInterfaces = networkInterfaces; | ||
const isFamilySupported = (family, allowInternal) => { | ||
let networkInterfaces = module.exports.networkInterfaces; | ||
if (!networkInterfaces) { | ||
// hope for the best | ||
return true; | ||
} | ||
const familySupported = | ||
@@ -25,3 +38,3 @@ // crux that replaces Object.values(networkInterfaces) as Object.values is not supported in nodejs v6 | ||
.reduce((acc, val) => acc.concat(val), []) | ||
.filter(i => !i.internal) | ||
.filter(i => !i.internal || allowInternal) | ||
.filter(i => i.family === 'IPv' + family || i.family === family).length > 0; | ||
@@ -32,4 +45,5 @@ | ||
const resolver = (family, hostname, callback) => { | ||
const familySupported = isFamilySupported(family); | ||
const resolver = (family, hostname, options, callback) => { | ||
options = options || {}; | ||
const familySupported = isFamilySupported(family, options.allowInternalNetworkInterfaces); | ||
@@ -113,3 +127,3 @@ if (!familySupported) { | ||
resolver(4, options.host, (err, addresses) => { | ||
resolver(4, options.host, options, (err, addresses) => { | ||
if (err) { | ||
@@ -148,3 +162,3 @@ if (cached) { | ||
resolver(6, options.host, (err, addresses) => { | ||
resolver(6, options.host, options, (err, addresses) => { | ||
if (err) { | ||
@@ -151,0 +165,0 @@ if (cached) { |
@@ -47,3 +47,3 @@ 'use strict'; | ||
let finished = false; | ||
let tempSocketErr = function (err) { | ||
let tempSocketErr = err => { | ||
if (finished) { | ||
@@ -61,2 +61,8 @@ return; | ||
let timeoutErr = () => { | ||
let err = new Error('Proxy socket timed out'); | ||
err.code = 'ETIMEDOUT'; | ||
tempSocketErr(err); | ||
}; | ||
socket = connect(options, () => { | ||
@@ -124,2 +130,5 @@ if (finished) { | ||
socket.removeListener('error', tempSocketErr); | ||
socket.removeListener('timeout', timeoutErr); | ||
socket.setTimeout(0); | ||
return callback(null, socket); | ||
@@ -131,2 +140,5 @@ } | ||
socket.setTimeout(httpProxyClient.timeout || 30 * 1000); | ||
socket.on('timeout', timeoutErr); | ||
socket.once('error', tempSocketErr); | ||
@@ -133,0 +145,0 @@ } |
@@ -59,2 +59,4 @@ 'use strict'; | ||
this.allowInternalNetworkInterfaces = this.options.allowInternalNetworkInterfaces || false; | ||
if (typeof this.options.secure === 'undefined' && this.port === 465) { | ||
@@ -221,3 +223,4 @@ // if secure option is not set but port is 465, then default to secure | ||
port: this.port, | ||
host: this.host | ||
host: this.host, | ||
allowInternalNetworkInterfaces: this.allowInternalNetworkInterfaces | ||
}; | ||
@@ -1760,6 +1763,12 @@ | ||
// defaul hostname is machine hostname or [IP] | ||
let defaultHostname = os.hostname() || ''; | ||
let defaultHostname; | ||
try { | ||
defaultHostname = os.hostname() || ''; | ||
} catch (err) { | ||
// fails on windows 7 | ||
defaultHostname = 'localhost'; | ||
} | ||
// ignore if not FQDN | ||
if (defaultHostname.indexOf('.') < 0) { | ||
if (!defaultHostname || defaultHostname.indexOf('.') < 0) { | ||
defaultHostname = '[127.0.0.1]'; | ||
@@ -1766,0 +1775,0 @@ } |
@@ -630,3 +630,3 @@ 'use strict'; | ||
}); | ||
} else if (!auth && connection.allowsAuth) { | ||
} else if (!auth && connection.allowsAuth && options.forceAuth) { | ||
let err = new Error('Authentication info was not provided'); | ||
@@ -633,0 +633,0 @@ err.code = 'NoAuth'; |
@@ -21,2 +21,3 @@ 'use strict'; | ||
options = options || {}; | ||
if (typeof options === 'string') { | ||
@@ -388,3 +389,3 @@ options = { | ||
}); | ||
} else if (!authData && connection.allowsAuth) { | ||
} else if (!authData && connection.allowsAuth && options.forceAuth) { | ||
let err = new Error('Authentication info was not provided'); | ||
@@ -391,0 +392,0 @@ err.code = 'NoAuth'; |
{ | ||
"name": "nodemailer", | ||
"version": "6.7.6", | ||
"version": "6.7.7", | ||
"description": "Easy as cake e-mail sending from your Node.js applications", | ||
@@ -23,4 +23,4 @@ "main": "lib/nodemailer.js", | ||
"devDependencies": { | ||
"@aws-sdk/client-ses": "3.118.1", | ||
"aws-sdk": "2.1165.0", | ||
"@aws-sdk/client-ses": "3.121.0", | ||
"aws-sdk": "2.1168.0", | ||
"bunyan": "1.8.15", | ||
@@ -27,0 +27,0 @@ "chai": "4.3.6", |
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
485634
11616