Skip to content

Commit

Permalink
fix(messageIdHeader-replace): ZMS-166 MessageID header safe replace (#18
Browse files Browse the repository at this point in the history
)
  • Loading branch information
NickOvt authored Aug 22, 2024
1 parent 61affc5 commit 929d094
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ module.exports.init = async app => {
const transhost = (envelope.transhost || '').replace('[', '').replace(']', '') || originhost;

const subject = messageinfo.subject || 'no subject';
const messageIdHeaderVal = allHeadersParsed['Message-ID']?.replace('<', '').replace('>', '');

// Call Zilter with required params
try {
Expand Down Expand Up @@ -190,7 +191,7 @@ module.exports.init = async app => {
_from: envelope.from,
_header_from: allHeadersParsed.From,
_header_to: allHeadersParsed.To,
_message_id: allHeadersParsed['Message-ID'].replace('<', '').replace('>', ''),
_message_id: messageIdHeaderVal,
_subject: subject,
level: 5,
_zilter_error: 'Unauthorized error 401',
Expand All @@ -210,7 +211,7 @@ module.exports.init = async app => {
_from: envelope.from,
_header_from: allHeadersParsed.From,
_header_to: allHeadersParsed.To,
_message_id: allHeadersParsed['Message-ID'].replace('<', '').replace('>', ''),
_message_id: messageIdHeaderVal,
_subject: subject,
level: 5,
_passed: 'N',
Expand All @@ -227,7 +228,7 @@ module.exports.init = async app => {
_from: envelope.from,
_header_from: allHeadersParsed.From,
_header_to: allHeadersParsed.To,
_message_id: allHeadersParsed['Message-ID'].replace('<', '').replace('>', ''),
_message_id: messageIdHeaderVal,
_subject: subject,
level: 5,
_passed: 'Y',
Expand All @@ -244,7 +245,7 @@ module.exports.init = async app => {
_from: envelope.from,
_header_from: allHeadersParsed.From,
_header_to: allHeadersParsed.To,
_message_id: allHeadersParsed['Message-ID'].replace('<', '').replace('>', ''),
_message_id: messageIdHeaderVal,
_subject: subject,
level: 5,
_zilter_error: err.message,
Expand Down

0 comments on commit 929d094

Please sign in to comment.