You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

mailparser

Package Overview
Dependencies
Maintainers
1
Versions
114
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

to
0.2.12

16

lib/mailparser.js

@@ -5,3 +5,3 @@

* @author <a href="mailto:andris@node.ee">Andris Reinman</a>
* @version 0.2.6
* @version 0.2.12
*/

@@ -134,3 +134,3 @@

chunk = chunk && chunk.toString("binary") || "";
chunk = chunk && chunk.toString("binary") || "";

@@ -246,3 +246,3 @@ // if the last chunk ended with \r and this one begins

// detect if this is an attachment or a text node (some agents use inline dispositions for text)
if(textContent && (!this._currentNode.meta.contentDisposition || this._currentNode.meta.contentDisposition == "inline")){
if(textContent && (!this._currentNode.meta.contentDisposition || this._currentNode.meta.contentDisposition == "inline")){
this._currentNode.attachment = false;

@@ -708,9 +708,9 @@ }else if((!textContent || ["attachment", "inline"].indexOf(this._currentNode.meta.contentDisposition)>=0) &&

if(this._currentNode.meta.contentType == "text/html"){
this._currentNode.meta.charset = this._detectHTMLCharset(this._currentNode.content) || this._currentNode.meta.charset || this.options.defaultCharset || "iso-8859-1";
this._currentNode.meta.charset = this._detectHTMLCharset(this._currentNode.content) || this._currentNode.meta.charset || this.options.defaultCharset || "iso-8859-1";
}
if(this._currentNode.meta.transferEncoding == "quoted-printable"){
this._currentNode.content = mimelib.decodeQuotedPrintable(this._currentNode.content, false, this._currentNode.meta.charset || this.options.defaultCharset || "iso-8859-1");
this._currentNode.content = mimelib.decodeQuotedPrintable(this._currentNode.content, false, this._currentNode.meta.charset || this.options.defaultCharset || "iso-8859-1");
}else if(this._currentNode.meta.transferEncoding == "base64"){
this._currentNode.content = mimelib.decodeBase64(this._currentNode.content, false, this._currentNode.meta.charset || this.options.defaultCharset || "iso-8859-1");
this._currentNode.content = mimelib.decodeBase64(this._currentNode.content, false, this._currentNode.meta.charset || this.options.defaultCharset || "iso-8859-1");
}else{

@@ -735,3 +735,3 @@ this._currentNode.content = this._encodeString(this._currentNode.content);

if(this._currentNode.stream){
streamInfo = this._currentNode.stream.end() || {};
streamInfo = this._currentNode.stream.end() || {};
if(streamInfo.checksum){

@@ -922,3 +922,3 @@ this._currentNode.meta.checksum = streamInfo.checksum;

MailParser.prototype._encodeString = function(value){
value = this._replaceMimeWords(this._convertString(value, this._currentNode.meta.charset || this.options.defaultCharset || "iso-8859-1").toString("utf-8"));
value = this._replaceMimeWords(this._convertString(value, this._currentNode.meta.charset || this.options.defaultCharset || "iso-8859-1").toString("utf-8"));
return value;

@@ -925,0 +925,0 @@ };

{
"name": "mailparser",
"description": "Asynchronous and non-blocking parser for mime encoded e-mail messages",
"version": "0.2.11",
"version": "0.2.12",
"author" : "Andris Reinman",

@@ -24,3 +24,3 @@ "maintainers":[

"dependencies": {
"mimelib": "0.1.10",
"mimelib": "0.1.11",
"iconv": "*"

@@ -27,0 +27,0 @@ },

@@ -189,4 +189,17 @@

## Issues
**S/MIME**
Currently it is not possible to verify signed content as the incoming text is
split to lines when parsing and line ending characters are not preserved. One
can assume it is always \r\n but this might not be always the case.
**Seeking**
Due to the line based parsing it is also not possible to explicitly state
the beginning and ending bytes of the attachments for later source seeking.
## License
**MIT**

@@ -267,4 +267,16 @@ var MailParser = require("../lib/mailparser").MailParser,

});
},
"Invalid Quoted-Printable": function(test){
var encodedText = "Content-type: text/plain; charset=utf-8\r\nContent-Transfer-Encoding: QUOTED-PRINTABLE\r\n\r\n==C3==95=C3=84=C3=96=C3=9C=",
mail = new Buffer(encodedText, "utf-8");
var mailparser = new MailParser();
mailparser.end(mail);
mailparser.on("end", function(mail){
test.equal(mail.text, "==ÄÖÜ");
test.done();
});
}
}

@@ -271,0 +283,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet