Skip to content

Commit

Permalink
fix(log-headerfromvalue): graylog header from value should be MIME de…
Browse files Browse the repository at this point in the history
…coded before logging ZMS-138 (#46)
  • Loading branch information
NickOvt authored Oct 3, 2024
1 parent 1fabcf4 commit 11f71a0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,16 @@ exports.hook_deny = function (next, connection, params) {
if (headerFrom) {
logdata._header_from = headerFrom.address;
logdata._header_from_name = headerFrom.provided && headerFrom.provided.name;
logdata._header_from_value = txn.header.get_all('From').join('; ');

let fromHeadersValue = txn.header.get_all('From').join('; ');

try {
fromHeadersValue = libmime.decodeWords(fromHeadersValue);
} catch {
// return as is
}

logdata._header_from_value = fromHeadersValue;
}

const err = params && params[1];
Expand Down

0 comments on commit 11f71a0

Please sign in to comment.