nodemailer
Advanced tools
Comparing version 6.4.10 to 6.4.11
# CHANGELOG | ||
## 6.4.11 2020-07-29 | ||
- Fixed escape sequence handling in address parsing | ||
## 6.4.10 2020-06-17 | ||
@@ -4,0 +8,0 @@ |
@@ -76,3 +76,3 @@ 'use strict'; | ||
let _regexHandler = function(address) { | ||
let _regexHandler = function (address) { | ||
if (!data.address.length) { | ||
@@ -199,5 +199,5 @@ data.address = [address.trim()]; | ||
checkChar(chr) { | ||
if ((chr in this.operators || chr === '\\') && this.escaped) { | ||
this.escaped = false; | ||
} else if (this.operatorExpecting && chr === this.operatorExpecting) { | ||
if (this.escaped) { | ||
// ignore next condition blocks | ||
} else if (chr === this.operatorExpecting) { | ||
this.node = { | ||
@@ -222,5 +222,3 @@ type: 'operator', | ||
return; | ||
} | ||
if (!this.escaped && chr === '\\') { | ||
} else if (['"', "'"].includes(this.operatorExpecting) && chr === '\\') { | ||
this.escaped = true; | ||
@@ -238,7 +236,13 @@ return; | ||
if (this.escaped && chr !== '\\') { | ||
this.node.value += '\\'; | ||
if (chr === '\n') { | ||
// Convert newlines to spaces. Carriage return is ignored as \r and \n usually | ||
// go together anyway and there already is a WS for \n. Lone \r means something is fishy. | ||
chr = ' '; | ||
} | ||
this.node.value += chr; | ||
if (chr.charCodeAt(0) >= 0x21 || [' ', '\t'].includes(chr)) { | ||
// skip command bytes | ||
this.node.value += chr; | ||
} | ||
this.escaped = false; | ||
@@ -245,0 +249,0 @@ } |
{ | ||
"name": "nodemailer", | ||
"version": "6.4.10", | ||
"version": "6.4.11", | ||
"description": "Easy as cake e-mail sending from your Node.js applications", | ||
@@ -24,7 +24,7 @@ "main": "lib/nodemailer.js", | ||
"devDependencies": { | ||
"bunyan": "1.8.12", | ||
"bunyan": "1.8.14", | ||
"chai": "4.2.0", | ||
"eslint-config-nodemailer": "1.2.0", | ||
"eslint-config-prettier": "6.11.0", | ||
"grunt": "1.1.0", | ||
"grunt": "1.2.1", | ||
"grunt-cli": "1.3.2", | ||
@@ -34,10 +34,10 @@ "grunt-eslint": "23.0.0", | ||
"libbase64": "1.2.1", | ||
"libmime": "4.2.1", | ||
"libmime": "5.0.0", | ||
"libqp": "1.1.0", | ||
"mocha": "8.0.1", | ||
"nodemailer-ntlm-auth": "1.0.1", | ||
"proxy": "1.0.1", | ||
"proxy": "1.0.2", | ||
"proxy-test-server": "1.0.0", | ||
"sinon": "9.0.2", | ||
"smtp-server": "3.6.0" | ||
"smtp-server": "3.7.0" | ||
}, | ||
@@ -44,0 +44,0 @@ "engines": { |
@@ -20,10 +20,20 @@ /* eslint no-control-regex:0 */ | ||
const footer = `Don't like this message? | ||
There's a Github Sponsors goal to remove it | ||
https://github.com/sponsors/andris9 | ||
`; | ||
const secs = 4; | ||
const formatCentered = (row, columns) => { | ||
if (columns <= row.length) { | ||
return row; | ||
} | ||
return row | ||
.split(/\r?\n/) | ||
.map(row => { | ||
if (columns <= row.length) { | ||
return row; | ||
} | ||
return ' '.repeat(Math.round(columns / 2 - row.length / 2)) + row; | ||
return ' '.repeat(Math.round(columns / 2 - row.length / 2)) + row; | ||
}) | ||
.join('\n'); | ||
}; | ||
@@ -63,6 +73,10 @@ | ||
return (formatCentered(title, columns) + '\n' + text) | ||
.split('\n') | ||
.flatMap(row => formatRow(row, columns)) | ||
.join('\n'); | ||
return ( | ||
(formatCentered(title, columns) + '\n' + text) | ||
.split('\n') | ||
.flatMap(row => formatRow(row, columns)) | ||
.join('\n') + | ||
'\n' + | ||
formatCentered(footer, columns) | ||
); | ||
}; | ||
@@ -69,0 +83,0 @@ |
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
468867
41
11403
0