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.24 to 0.2.25

18

lib/mailparser.js

@@ -463,3 +463,3 @@

case "references":
this._currentNode.meta.messageReferences = this._trimQuotes(value);
this._parseReferences(value);
break;

@@ -688,2 +688,14 @@ case "in-reply-to":

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

@@ -905,2 +917,6 @@ *

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

@@ -907,0 +923,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.24",
"version": "0.2.25",
"author" : "Andris Reinman",

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

@@ -83,2 +83,3 @@ MailParser

* **subject** - the subject line
* **references** - an array of reference message id values
* **priority** - priority of the e-mail, always one of the following: *normal* (default), *high*, *low*

@@ -210,6 +211,2 @@ * **text** - text body

## Docs
See autogenerated docs for the code [here](http://www.node.ee/jsdoc/symbols/MailParser.html).
## Issues

@@ -216,0 +213,0 @@

@@ -163,2 +163,35 @@ var MailParser = require("../lib/mailparser").MailParser,

});
},
"Single reference": function(test){
var encodedText = "Content-type: text/plain\r" +
"References: <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.references, ["mail1"]);
test.done();
});
},
"Multiple references": function(test){
var encodedText = "Content-type: text/plain\r" +
"References: <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.references, ["mail1", "mail2", "mail3"]);
test.done();
});
}

@@ -165,0 +198,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