From 82913a1a14172ecc89891309264e29ceae169312 Mon Sep 17 00:00:00 2001 From: Andris Reinman Date: Mon, 13 Nov 2017 15:36:43 +0200 Subject: [PATCH] fixed broken forwarding --- lib/filter-handler.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/filter-handler.js b/lib/filter-handler.js index 2aff4ebd..7ae859d0 100644 --- a/lib/filter-handler.js +++ b/lib/filter-handler.js @@ -329,7 +329,11 @@ class FilterHandler { let forwardMessage = done => { if (userData.forward && !filterActions.get('delete')) { // forward to default recipient only if the message is not deleted - forwardTargets.set(userData.forward, { type: 'mail', value: userData.forward }); + (Array.isArray(userData.forward) ? userData.forward : [].concat(userData.forward || [])).forEach(forward => { + if (forward) { + forwardTargets.set(forward, { type: 'mail', value: forward }); + } + }); } if (userData.targetUrl && !filterActions.get('delete')) {