From f32dc147e631ac398d5d3a661611e607d2688c47 Mon Sep 17 00:00:00 2001 From: NickOvt Date: Thu, 1 Aug 2024 10:34:08 +0300 Subject: [PATCH] fix(lib-filter): ZMS-161 (#718) * Save delivered-to and return-path headers as bin strings in mongo so that view source in webmail works correctly --- lib/filter-handler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/filter-handler.js b/lib/filter-handler.js index 05c29947..40ae63c4 100644 --- a/lib/filter-handler.js +++ b/lib/filter-handler.js @@ -163,8 +163,8 @@ class FilterHandler { }); } - prepared.mimeTree.header.unshift('Return-Path: <' + sender + '>'); - prepared.mimeTree.header.unshift('Delivered-To: ' + recipient); + prepared.mimeTree.header.unshift('Return-Path: <' + Buffer.from(sender).toString('binary') + '>'); + prepared.mimeTree.header.unshift('Delivered-To: ' + Buffer.from(recipient).toString('binary')); prepared.mimeTree.parsedHeader['return-path'] = '<' + sender + '>'; prepared.mimeTree.parsedHeader['delivered-to'] = '<' + recipient + '>';