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.4.7 to 0.4.8

4

lib/mailparser.js

@@ -334,3 +334,3 @@ "use strict";

this.emit("attachment", attachment);
this.emit("attachment", attachment, this._currentNode.parentNode);
} else {

@@ -523,3 +523,3 @@ this._currentNode.content = undefined;

this._currentNode.meta.location = value.toLowerCase();
break;
break;
case "subject":

@@ -526,0 +526,0 @@ this._currentNode.subject = this._encodeString(value);

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

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

@@ -179,3 +179,3 @@ MailParser

mp.on("attachment", function(attachment){
mp.on("attachment", function(attachment, mail){
var output = fs.createWriteStream(attachment.generatedFileName);

@@ -182,0 +182,0 @@ attachment.stream.pipe(output);

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

},
"Pass mail node to headers event": function(test){
var encodedText = "Content-type: multipart/mixed; boundary=ABC\r\n"+
"Subject: ABCDEF\r\n"+
"\r\n"+
"--ABC\r\n"+
"Content-Type: application/octet-stream\r\n"+
"Content-Transfer-Encoding: base64\r\n"+
"Content-Disposition: attachment\r\n"+
"\r\n"+
"AAECAwQFBg==\r\n"+
"--ABC--",
expectedHash = "9aa461e1eca4086f9230aa49c90b0c61",
mail = new Buffer(encodedText, "utf-8");
var mailparser = new MailParser({streamAttachments: true});
for(var i=0, len = mail.length; i<len; i++){
mailparser.write(new Buffer([mail[i]]));
}
test.expect(2);
mailparser.on("attachment", function(attachment, email){
test.equal(email.subject, "ABCDEF");
});
mailparser.end();
mailparser.on("end", function(mail){
test.ok(1, "Done");
test.done();
});
},
"Detect Content-Type by filename": function(test){

@@ -1297,0 +1331,0 @@ var encodedText = "Content-type: multipart/mixed; boundary=ABC\r\n"+

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