New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mailparser

Package Overview
Dependencies
Maintainers
1
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mailparser - npm Package Compare versions

Comparing version 0.2.25 to 0.2.26

30

lib/mailparser.js

@@ -466,3 +466,3 @@

case "in-reply-to":
this._currentNode.meta.inReplyTo = this._trimQuotes(value);
this._parseInReplyTo(value);
break;

@@ -693,9 +693,25 @@ case "thread-index":

MailParser.prototype._parseReferences = function(value){
this._currentNode.references = (value || "").toString().
trim().
split(/\s+/).
map(this._trimQuotes.bind(this));
this._currentNode.references = (this._currentNode.references || []).concat(
(value || "").toString().
trim().
split(/\s+/).
map(this._trimQuotes.bind(this))
);
}
/**
* <p>Parses "In-Reply-To" header</p>
*
* @param {String} value In-Reply-To header field
*/
MailParser.prototype._parseInReplyTo = function(value){
this._currentNode.inReplyTo = (this._currentNode.inReplyTo || []).concat(
(value || "").toString().
trim().
split(/\s+/).
map(this._trimQuotes.bind(this))
);
}
/**
* <p>Parses the priority of the e-mail</p>

@@ -921,2 +937,6 @@ *

if(this.mimeTree.inReplyTo){
returnValue.inReplyTo = this.mimeTree.inReplyTo;
}
if(this.mimeTree.priority){

@@ -923,0 +943,0 @@ returnValue.priority = this.mimeTree.priority;

2

package.json
{
"name": "mailparser",
"description": "Asynchronous and non-blocking parser for mime encoded e-mail messages",
"version": "0.2.25",
"version": "0.2.26",
"author" : "Andris Reinman",

@@ -6,0 +6,0 @@ "maintainers":[

@@ -83,3 +83,4 @@ MailParser

* **subject** - the subject line
* **references** - an array of reference message id values
* **references** - an array of reference message id values (not set if no reference values present)
* **inReplyTo** - an array of In-Reply-To message id values (not set if no in-reply-to values present)
* **priority** - priority of the e-mail, always one of the following: *normal* (default), *high*, *low*

@@ -223,2 +224,3 @@ * **text** - text body

the beginning and ending bytes of the attachments for later source seeking.
Node.js doesn't support the concept of seeking very well anyway.

@@ -225,0 +227,0 @@ ## License

@@ -181,3 +181,3 @@ var MailParser = require("../lib/mailparser").MailParser,

"Multiple references": function(test){
"Multiple reference values": function(test){
var encodedText = "Content-type: text/plain\r" +

@@ -197,2 +197,69 @@ "References: <mail1>\n" +

});
},
"Multiple reference fields": function(test){
var encodedText = "Content-type: text/plain\r" +
"References: <mail1>\n" +
"References: <mail3>\n"
"\r" +
"1234",
mail = new Buffer(encodedText, "utf-8");
test.expect(1);
var mailparser = new MailParser();
mailparser.end(mail);
mailparser.on("end", function(mail){
test.deepEqual(mail.references, ["mail1", "mail3"]);
test.done();
});
},
"Single in-reply-to": function(test){
var encodedText = "Content-type: text/plain\r" +
"in-reply-to: <mail1>\n" +
"\r" +
"1234",
mail = new Buffer(encodedText, "utf-8");
test.expect(1);
var mailparser = new MailParser();
mailparser.end(mail);
mailparser.on("end", function(mail){
test.deepEqual(mail.inReplyTo, ["mail1"]);
test.done();
});
},
"Multiple in-reply-to values": function(test){
var encodedText = "Content-type: text/plain\r" +
"in-reply-to: <mail1>\n" +
" <mail2> <mail3>\n"
"\r" +
"1234",
mail = new Buffer(encodedText, "utf-8");
test.expect(1);
var mailparser = new MailParser();
mailparser.end(mail);
mailparser.on("end", function(mail){
test.deepEqual(mail.inReplyTo, ["mail1", "mail2", "mail3"]);
test.done();
});
},
"Multiple in-reply-to fields": function(test){
var encodedText = "Content-type: text/plain\r" +
"in-reply-to: <mail1>\n" +
"in-reply-to: <mail3>\n"
"\r" +
"1234",
mail = new Buffer(encodedText, "utf-8");
test.expect(1);
var mailparser = new MailParser();
mailparser.end(mail);
mailparser.on("end", function(mail){
test.deepEqual(mail.inReplyTo, ["mail1", "mail3"]);
test.done();
});
}

@@ -199,0 +266,0 @@

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