haraka-plugin-headers
Advanced tools
Comparing version
@@ -5,12 +5,13 @@ | ||
### [1.0.4] - 2023-12-12 | ||
- ci: publish updates, shared test actions | ||
- doc(README): formatting | ||
### [1.0.3] - 2022-06-05 | ||
#### Added | ||
- feat: instead of early exits, skip registering | ||
- feat: add phish test | ||
- feat(from_phish): check against SPF, DKIM, and ENV FROM | ||
#### Changed | ||
- ci: depends on shared haraka GHA workflows | ||
@@ -34,1 +35,2 @@ - ci(codeclimate): relax some checks | ||
[1.0.3]: https://github.com/haraka/haraka-plugin-headers/releases/tag/1.0.3 | ||
[1.0.4]: https://github.com/haraka/haraka-plugin-headers/releases/tag/1.0.4 |
15
index.js
@@ -76,8 +76,7 @@ // validate message headers and some fields | ||
const failures = []; | ||
for (let i=0; i < singular.length; i++ ) { | ||
if (connection.transaction.header.get_all(singular[i]).length <= 1) { | ||
for (const name of singular) { | ||
if (connection.transaction.header.get_all(name).length <= 1) { | ||
continue; | ||
} | ||
const name = singular[i]; | ||
connection.transaction.results.add(plugin, {fail: `duplicate:${name}`}); | ||
@@ -226,4 +225,3 @@ failures.push(name); | ||
// for (const h in headers) {} | ||
for (let i=0; i < headers.length; i++) { | ||
const name = headers[i]; | ||
for (const name of headers) { | ||
const header = connection.transaction.header.get(name); | ||
@@ -344,4 +342,4 @@ if (!header) continue; // header not present | ||
const rcpts = connection.transaction.rcpt_to; | ||
for (let i=0; i<rcpts.length; i++) { | ||
const rcpt = rcpts[i].address(); | ||
for (const rcptElement of rcpts) { | ||
const rcpt = rcptElement.address(); | ||
if (rcpt !== del_to) continue; | ||
@@ -380,4 +378,3 @@ connection.transaction.results.add(plugin, {emit: true, fail: 'delivered_to'}); | ||
if (!header) { return; } // header not present | ||
for (let i=0; i < mlms[name].length; i++) { | ||
const j = mlms[name][i]; | ||
for (const j of mlms[name]) { | ||
if (j.start) { | ||
@@ -384,0 +381,0 @@ if (header.substring(0,j.start.length) === j.start) { |
{ | ||
"name": "haraka-plugin-headers", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Haraka plugin that performs tests on email headers", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
[![CI Tests][ci-img]][ci-url] | ||
[![Code Climate][clim-img]][clim-url] | ||
[![NPM][npm-img]][npm-url] | ||
@@ -4,0 +5,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
136
0.74%0
-100%39857
-1.09%719
-0.42%