Skip to content

Commit

Permalink
v3.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Oct 3, 2021
1 parent 6cb4b55 commit bea222a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
15 changes: 10 additions & 5 deletions lib/mail-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,13 +313,18 @@ class MailParser extends Transform {
}
});
break;
case 'date':
value = anyDateParser.fromString(value);
if (isNaN(value)) {
// date parsing failed :S
value = new Date();
case 'date': {
let dateValue = new Date(value);
if (isNaN(dateValue)) {
dateValue = anyDateParser.fromString(value);
if (isNaN(dateValue)) {
// date parsing failed :S
dateValue = new Date();
}
}
value = dateValue;
break;
}
case 'subject':
try {
value = this.libmime.decodeWords(value);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mailparser",
"version": "3.3.2",
"version": "3.3.3",
"description": "Parse e-mails",
"main": "index.js",
"scripts": {
Expand All @@ -22,7 +22,7 @@
"html-to-text": "8.0.0",
"iconv-lite": "0.6.3",
"libmime": "5.0.0",
"linkify-it": "3.0.2",
"linkify-it": "3.0.3",
"mailsplit": "5.2.0",
"nodemailer": "6.6.5",
"tlds": "1.222.0"
Expand Down

0 comments on commit bea222a

Please sign in to comment.