mailparser
Advanced tools
Comparing version 2.7.6 to 2.7.7
@@ -55,3 +55,3 @@ 'use strict'; | ||
// https://github.com/bnoordhuis/node-iconv/issues/169 | ||
if (charset === 'ks_c_5601-1987') { | ||
if (charset.toLowerCase() === 'ks_c_5601-1987') { | ||
charset = 'CP949'; | ||
@@ -360,3 +360,3 @@ } | ||
case 'return-path': | ||
value = addressparser(this.libmime.decodeWords(value)); | ||
value = addressparser(value); | ||
this.decodeAddresses(value); | ||
@@ -505,4 +505,18 @@ value = { | ||
decodeAddresses(addresses) { | ||
addresses.forEach(address => { | ||
address.name = (address.name || '').toString(); | ||
for (let i = 0; i < addresses.length; i++) { | ||
let address = addresses[i]; | ||
address.name = (address.name || '').toString().trim(); | ||
if (!address.address && /^(=\?([^?]+)\?[Bb]\?[^?]*\?=)(\s*=\?([^?]+)\?[Bb]\?[^?]*\?=)*$/.test(address.name)) { | ||
let parsed = addressparser(this.libmime.decodeWords(address.name)); | ||
if (parsed.length) { | ||
parsed.forEach(entry => addresses.push(entry)); | ||
} | ||
// remove current element | ||
addresses.splice(i, 1); | ||
i--; | ||
continue; | ||
} | ||
if (address.name) { | ||
@@ -523,3 +537,3 @@ try { | ||
} | ||
}); | ||
} | ||
} | ||
@@ -526,0 +540,0 @@ |
{ | ||
"name": "mailparser", | ||
"version": "2.7.6", | ||
"version": "2.7.7", | ||
"description": "Parse e-mails", | ||
@@ -25,11 +25,11 @@ "main": "index.js", | ||
"linkify-it": "2.2.0", | ||
"mailsplit": "4.4.1", | ||
"nodemailer": "6.3.1", | ||
"tlds": "1.203.1" | ||
"mailsplit": "4.6.2", | ||
"nodemailer": "6.4.0", | ||
"tlds": "1.207.0" | ||
}, | ||
"devDependencies": { | ||
"ajv": "6.10.2", | ||
"eslint": "6.6.0", | ||
"eslint": "6.7.2", | ||
"eslint-config-nodemailer": "1.2.0", | ||
"eslint-config-prettier": "6.5.0", | ||
"eslint-config-prettier": "6.7.0", | ||
"grunt": "1.0.4", | ||
@@ -36,0 +36,0 @@ "grunt-cli": "1.3.2", |
60734
10
1157
+ Addedmailsplit@4.6.2(transitive)
+ Addednodemailer@6.4.0(transitive)
+ Addedtlds@1.207.0(transitive)
- Removediconv-lite@0.4.24(transitive)
- Removedlibbase64@1.0.3(transitive)
- Removedlibmime@4.1.1(transitive)
- Removedmailsplit@4.4.1(transitive)
- Removednodemailer@6.3.1(transitive)
- Removedtlds@1.203.1(transitive)
Updatedmailsplit@4.6.2
Updatednodemailer@6.4.0
Updatedtlds@1.207.0