From 90bf428febd21817c250fdd39a94c2edb04ba91f Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Thu, 30 Jan 2025 19:22:04 -0800 Subject: [PATCH 1/6] doc(CONTRIBUTORS): added --- .release | 2 +- CONTRIBUTORS.md | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 CONTRIBUTORS.md diff --git a/.release b/.release index afb1db8..180d818 160000 --- a/.release +++ b/.release @@ -1 +1 @@ -Subproject commit afb1db801607dda5e859f39b600f0dd0111e4651 +Subproject commit 180d818a31f69b7f0295cd0eb85cb44c45439a8b diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md new file mode 100644 index 0000000..d5c44c0 --- /dev/null +++ b/CONTRIBUTORS.md @@ -0,0 +1,9 @@ +# Contributors + +This handcrafted artisinal software is brought to you by: + +|
msimerson (7)|
lnedry (2)| +| :---: | :---: | + +this file is generated by [.release](https://github.com/msimerson/.release). +Contribute to this project to get your GitHub profile included here. From d83ef0145eac5d4270dffa7f963b485ba8b02a7f Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Thu, 30 Jan 2025 19:23:12 -0800 Subject: [PATCH 2/6] doc(CONTRIBUTORS): added --- .eslintrc.yaml | 10 ---------- CHANGELOG.md | 8 ++++++-- README.md | 4 ---- eslint.config.mjs | 26 ++++++++++++++++++++++++++ package.json | 4 ++-- 5 files changed, 34 insertions(+), 18 deletions(-) delete mode 100644 .eslintrc.yaml create mode 100644 eslint.config.mjs diff --git a/.eslintrc.yaml b/.eslintrc.yaml deleted file mode 100644 index 4c1bf2a..0000000 --- a/.eslintrc.yaml +++ /dev/null @@ -1,10 +0,0 @@ -env: - node: true - es6: true - mocha: true - es2022: true - -extends: ['@haraka'] - -rules: - no-unused-vars: 1 diff --git a/CHANGELOG.md b/CHANGELOG.md index da7121a..c600d8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). ### Unreleased +### [1.0.2] - 2025-01-30 + +- doc(CONTRIBUTORS): added + ### [1.0.1] - 2024-11-04 - Merge pull request #2 from lnedry/master - - fix: removed redundant timer. - chore: remove unused set of conn.notes.prev_helo @@ -15,5 +18,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). - initial release -[1.0.0]: https://github.com/haraka/haraka-plugin-template/releases/tag/v1.0.0 +[1.0.0]: https://github.com/haraka/haraka-plugin-helo.checks/releases/tag/v1.0.0 [1.0.1]: https://github.com/haraka/haraka-plugin-helo.checks/releases/tag/v1.0.1 +[1.0.2]: https://github.com/haraka/haraka-plugin-helo.checks/releases/tag/v1.0.2 diff --git a/README.md b/README.md index b9c1f87..412b494 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ [![CI Test Status][ci-img]][ci-url] [![Code Climate][clim-img]][clim-url] -[![NPM][npm-img]][npm-url] - # haraka-plugin-helo.checks This plugin performs a number of checks on the HELO string. @@ -151,5 +149,3 @@ gmail.com=google.com [ci-url]: https://github.com/haraka/haraka-plugin-helo.checks/actions/workflows/ci.yml [clim-img]: https://codeclimate.com/github/haraka/haraka-plugin-helo.checks/badges/gpa.svg [clim-url]: https://codeclimate.com/github/haraka/haraka-plugin-helo.checks -[npm-img]: https://nodei.co/npm/haraka-plugin-helo.checks.png -[npm-url]: https://www.npmjs.com/package/haraka-plugin-helo.checks diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..5c949b1 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,26 @@ +import globals from "globals"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends("@haraka"), { + languageOptions: { + globals: { + ...globals.node, + ...globals.mocha, + }, + }, + + rules: { + "no-unused-vars": 1, + }, +}]; \ No newline at end of file diff --git a/package.json b/package.json index a5d47d5..029682a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "haraka-plugin-helo.checks", - "version": "1.0.1", + "version": "1.0.2", "description": "Haraka plugin checks the HELO string.", "main": "index.js", "files": [ @@ -40,4 +40,4 @@ "haraka-tld": "^1.2.2", "haraka-utils": "^1.1.3" } -} \ No newline at end of file +} From dafbd7ebd0fe734dc9bbc0abc8bcb6fc4b343416 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Fri, 31 Jan 2025 09:34:04 -0800 Subject: [PATCH 3/6] dep(eslint): upgrade to v9 --- .codeclimate.yml | 4 ++-- .prettierrc | 2 -- CHANGELOG.md | 2 ++ package.json | 16 ++++++++++------ 4 files changed, 14 insertions(+), 10 deletions(-) delete mode 100644 .prettierrc diff --git a/.codeclimate.yml b/.codeclimate.yml index c889eb8..563da6b 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -1,9 +1,9 @@ engines: eslint: enabled: true - channel: 'eslint-8' + channel: 'eslint-9' config: - config: '.eslintrc.yaml' + config: 'eslint.config.mjs' ratings: paths: diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 8ded5e0..0000000 --- a/.prettierrc +++ /dev/null @@ -1,2 +0,0 @@ -singleQuote: true -semi: false diff --git a/CHANGELOG.md b/CHANGELOG.md index c600d8f..cc6d6fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). ### [1.0.2] - 2025-01-30 +- dep(eslint): upgrade to v9 +- dep(all): bump versions - doc(CONTRIBUTORS): added ### [1.0.1] - 2024-11-04 diff --git a/package.json b/package.json index 029682a..6f11a60 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,8 @@ ], "scripts": { "format": "npm run prettier:fix && npm run lint:fix", - "lint": "npx eslint@^8 *.js test", - "lint:fix": "npx eslint@^8 *.js test --fix", + "lint": "npx eslint@^9 *.js test", + "lint:fix": "npx eslint@^9 *.js test --fix", "prettier": "npx prettier . --check", "prettier:fix": "npx prettier . --write --log-level=warn", "test": "node --test", @@ -32,12 +32,16 @@ }, "homepage": "https://github.com/haraka/haraka-plugin-helo.checks#readme", "devDependencies": { - "@haraka/eslint-config": "1.1.5", + "@haraka/eslint-config": "^2.0.2", "haraka-test-fixtures": "1.3.8" }, "dependencies": { - "haraka-net-utils": "^1.7.0", - "haraka-tld": "^1.2.2", + "haraka-net-utils": "^1.7.1", + "haraka-tld": "^1.2.3", "haraka-utils": "^1.1.3" + }, + "prettier": { + "singleQuote": true, + "semi": false } -} +} \ No newline at end of file From aa6acf15db4705412c91302b824091ad2c37bb75 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Fri, 31 Jan 2025 09:34:22 -0800 Subject: [PATCH 4/6] chore: format --- CONTRIBUTORS.md | 4 ++-- eslint.config.mjs | 39 +++++++++++++++++++++------------------ package.json | 2 +- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index d5c44c0..aff93a2 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -2,8 +2,8 @@ This handcrafted artisinal software is brought to you by: -|
msimerson (7)|
lnedry (2)| -| :---: | :---: | +|
msimerson (7) |
lnedry (2) | +| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | this file is generated by [.release](https://github.com/msimerson/.release). Contribute to this project to get your GitHub profile included here. diff --git a/eslint.config.mjs b/eslint.config.mjs index 5c949b1..d9aaa82 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,26 +1,29 @@ -import globals from "globals"; -import path from "node:path"; -import { fileURLToPath } from "node:url"; -import js from "@eslint/js"; -import { FlatCompat } from "@eslint/eslintrc"; +import globals from 'globals' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import js from '@eslint/js' +import { FlatCompat } from '@eslint/eslintrc' -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); +const __filename = fileURLToPath(import.meta.url) +const __dirname = path.dirname(__filename) const compat = new FlatCompat({ - baseDirectory: __dirname, - recommendedConfig: js.configs.recommended, - allConfig: js.configs.all -}); + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all, +}) -export default [...compat.extends("@haraka"), { +export default [ + ...compat.extends('@haraka'), + { languageOptions: { - globals: { - ...globals.node, - ...globals.mocha, - }, + globals: { + ...globals.node, + ...globals.mocha, + }, }, rules: { - "no-unused-vars": 1, + 'no-unused-vars': 1, }, -}]; \ No newline at end of file + }, +] diff --git a/package.json b/package.json index 6f11a60..3d2256f 100644 --- a/package.json +++ b/package.json @@ -44,4 +44,4 @@ "singleQuote": true, "semi": false } -} \ No newline at end of file +} From 7f1e1aa3d41391df4fd87786098591ccba5465de Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Fri, 31 Jan 2025 09:35:38 -0800 Subject: [PATCH 5/6] prettier: move config into package.json --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc6d6fa..3bda580 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). ### [1.0.2] - 2025-01-30 +- prettier: move config into package.json - dep(eslint): upgrade to v9 - dep(all): bump versions - doc(CONTRIBUTORS): added From cc4e22353ab1d9831846a0bdf20634c131153a42 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Fri, 31 Jan 2025 09:43:34 -0800 Subject: [PATCH 6/6] replace .replace(//g) with a replaceAll --- CHANGELOG.md | 1 + index.js | 2 +- test/index.js | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bda580..fb6058c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). ### [1.0.2] - 2025-01-30 +- replace .replace(//g) with a replaceAll - prettier: move config into package.json - dep(eslint): upgrade to v9 - dep(all): bump versions diff --git a/index.js b/index.js index 18bb1c7..138e7c8 100644 --- a/index.js +++ b/index.js @@ -320,7 +320,7 @@ exports.big_company = function (next, connection, helo) { const allowed_rdns = this.cfg.bigco[helo].split(/,/) for (const allow of allowed_rdns) { - const re = new RegExp(`${allow.replace(/\./g, '\\.')}$`) + const re = new RegExp(`${allow.replaceAll('.', '\\.')}$`) if (re.test(rdns)) { connection.results.add(this, { pass: 'big_co' }) return next() diff --git a/test/index.js b/test/index.js index 006f14c..65a49da 100644 --- a/test/index.js +++ b/test/index.js @@ -334,8 +334,8 @@ describe('helo.checks', () => { beforeEach(_set_up) it('pass, reject=false', (t, done) => { - const test_helo = 'yahoo.com' - this.connection.remote.host = 'yahoo.com' + const test_helo = 'yahoo.co.jp' + this.connection.remote.host = 'yahoo.co.jp' this.plugin.cfg.check.big_company = true this.plugin.cfg.reject.big_company = true this.plugin.big_company(