From e6e4e162f6591499db268dd99fedc693dd562659 Mon Sep 17 00:00:00 2001 From: Andris Reinman Date: Fri, 20 Oct 2017 16:27:03 +0300 Subject: [PATCH] try next received header --- lib/autoreply.js | 5 +++-- lib/forward.js | 5 +++-- lib/maildrop.js | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/autoreply.js b/lib/autoreply.js index 9861277f..cace65cd 100644 --- a/lib/autoreply.js +++ b/lib/autoreply.js @@ -111,13 +111,14 @@ module.exports = (options, callback) => { return callback(err, ...args); } db.database.collection('messagelog').insertOne({ - id: args[0], + id: args[0].id, + messageId: args[0].messageId, parentId: options.parentId, action: 'AUTOREPLY', from: '', to: options.sender, created: new Date() - }, () => callback(err, ...args)); + }, () => callback(err, args && args[0] && args[0].id)); } ); diff --git a/lib/forward.js b/lib/forward.js index afae28be..061ccf99 100644 --- a/lib/forward.js +++ b/lib/forward.js @@ -28,7 +28,8 @@ module.exports = (options, callback) => { return callback(err, ...args); } db.database.collection('messagelog').insertOne({ - id: args[0], + id: args[0].id, + messageId: args[0].messageId, action: 'FORWARD', parentId: options.parentId, from: options.sender, @@ -37,7 +38,7 @@ module.exports = (options, callback) => { http: !!options.targetUrl, targeUrl: options.targetUrl, created: new Date() - }, () => callback(err, ...args)); + }, () => callback(err, args && args[0] && args[0].id)); } ); diff --git a/lib/maildrop.js b/lib/maildrop.js index faa934a2..1d496146 100644 --- a/lib/maildrop.js +++ b/lib/maildrop.js @@ -255,7 +255,7 @@ module.exports = (options, callback) => { return callback(err); } - callback(null, id); + callback(null, envelope); }); }); });