From 8c6b91c70307ce2114ec544540f3285148abadab Mon Sep 17 00:00:00 2001 From: Gregor Martynus Date: Thu, 15 Jan 2015 10:20:54 +0100 Subject: [PATCH] pass email to "attachment" event --- index.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 56a12cb..64557c8 100644 --- a/index.js +++ b/index.js @@ -112,8 +112,8 @@ function parseUnread() { self.emit('mail',mail,seqno,attributes); } }); - parser.on("attachment", function (attachment) { - self.emit('attachment', attachment); + parser.on("attachment", function (attachment, email) { + self.emit('attachment', attachment, email); }); msg.on('body', function(stream, info) { stream.pipe(parser); diff --git a/package.json b/package.json index f83c7ea..453cf02 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Mail listener library for node.js. Get notification when new email arrived.", "dependencies": { "imap": "~0.8.14", - "mailparser": "~0.4.6", + "mailparser": "^0.4.8", "async": "^0.9.0" }, "repository": {