haraka-plugin-rspamd
Advanced tools
Comparing version 1.1.8 to 1.2.0
### Unreleased | ||
### [1.2.0] - 2022-10-14 | ||
- Make milter header handling compatible with rspamd 3.3 (#30) | ||
### [1.1.8] - 2022-06-06 | ||
@@ -62,1 +67,2 @@ | ||
[1.1.8]: https://github.com/haraka/haraka-plugin-rspamd/releases/tag/1.1.8 | ||
[1.1.9]: https://github.com/haraka/haraka-plugin-rspamd/releases/tag/1.1.9 |
21
index.js
@@ -188,11 +188,22 @@ 'use strict'; | ||
if (data.milter.add_headers) { | ||
connection.logdebug(`milter.add_headers: ${JSON.stringify(data.milter.add_headers)}`, plugin); | ||
Object.keys(data.milter.add_headers).forEach((key) => { | ||
const header_value = data.milter.add_headers[key]; | ||
if (!header_value) return; | ||
const header_values = data.milter.add_headers[key]; | ||
if (!header_values) return; | ||
if (typeof header_value === 'object') { | ||
connection.transaction.add_header(key, header_value.value); | ||
if (Object.prototype.toString.call(header_values) == '[object Array]') { | ||
header_values.forEach(function (header_value, header_index) { | ||
if (typeof header_value === 'object') { | ||
connection.transaction.add_header(key, header_value.value); | ||
} | ||
else { | ||
connection.transaction.add_header(key, header_value); | ||
} | ||
}); | ||
} | ||
else if (typeof header_values === 'object') { | ||
connection.transaction.add_header(key, header_values.value); | ||
} | ||
else { | ||
connection.transaction.add_header(key, header_value); | ||
connection.transaction.add_header(key, header_values); | ||
} | ||
@@ -199,0 +210,0 @@ }) |
{ | ||
"name": "haraka-plugin-rspamd", | ||
"version": "1.1.8", | ||
"version": "1.2.0", | ||
"description": "Haraka plugin for rspamd", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30045
586