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": {