mailparser
Advanced tools
Comparing version 0.2.24 to 0.2.25
@@ -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; |
{ | ||
"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 @@ |
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
0
111832
9
2402
225