fixed broken forwarding

This commit is contained in:
Andris Reinman 2017-11-13 15:36:43 +02:00
parent 23516a47a9
commit 82913a1a14

View file

@ -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')) {