Skip to content

Commit

Permalink
ci: publish updates
Browse files Browse the repository at this point in the history
style: use es6 for...of
  • Loading branch information
msimerson committed Dec 13, 2023
1 parent c7ece8b commit e2aaabf
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI

on: [ push ]
on: [ push, pull_request ]

env:
CI: true
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- master
paths:
- package.json

env:
CI: true
Expand Down
2 changes: 1 addition & 1 deletion .release
Submodule .release updated 4 files
+6 −2 CHANGELOG.md
+8 −0 README.md
+4 −1 finish.sh
+2 −2 submit.sh
17 changes: 17 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@
### Unreleased


### [1.0.4] - 2023-12-12

#### Added

-

#### Fixed

-

#### Changed

-



### [1.0.3] - 2022-06-05

#### Added
Expand Down Expand Up @@ -30,3 +46,4 @@
- added from_phish

[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 changes: 6 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,11 @@ exports.duplicate_singular = function (next, connection) {
];

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}`});
failures.push(name);
}
Expand Down Expand Up @@ -222,8 +221,7 @@ exports.user_agent = function (next, connection) {
'x-ms-has-attach'
];
// 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);
if (!header) continue; // header not present
found_ua++;
Expand Down Expand Up @@ -339,8 +337,8 @@ exports.delivered_to = function (next, connection) {
if (!del_to) return next();

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;
connection.transaction.results.add(plugin, {emit: true, fail: 'delivered_to'});
if (!plugin.cfg.reject.delivered_to) continue;
Expand Down Expand Up @@ -374,8 +372,7 @@ exports.mailing_list = function (next, connection) {
Object.keys(mlms).forEach(name => {
const header = connection.transaction.header.get(name);
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) {
if (header.substring(0,j.start.length) === j.start) {
txr.add(plugin, {pass: `MLM(${j.mlm})`});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "haraka-plugin-headers",
"version": "1.0.3",
"version": "1.0.4",
"description": "Haraka plugin that performs tests on email headers",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit e2aaabf

Please sign in to comment.