Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.0.2 #4

Merged
merged 6 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
engines:
eslint:
enabled: true
channel: 'eslint-8'
channel: 'eslint-9'
config:
config: '.eslintrc.yaml'
config: 'eslint.config.mjs'

ratings:
paths:
Expand Down
10 changes: 0 additions & 10 deletions .eslintrc.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions .prettierrc

This file was deleted.

2 changes: 1 addition & 1 deletion .release
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).

### Unreleased

### [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
- 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

### [1.0.0] - 2024-05-08

- 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
9 changes: 9 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Contributors

This handcrafted artisinal software is brought to you by:

| <img height="80" src="https://avatars.githubusercontent.com/u/261635?v=4"><br><a href="https://github.com/msimerson">msimerson</a> (<a href="https://github.com/haraka/haraka-plugin-helo.checks/commits?author=msimerson">7</a>) | <img height="80" src="https://avatars.githubusercontent.com/u/203240?v=4"><br><a href="https://github.com/lnedry">lnedry</a> (<a href="https://github.com/haraka/haraka-plugin-helo.checks/commits?author=lnedry">2</a>) |
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |

<sub>this file is generated by [.release](https://github.com/msimerson/.release).
Contribute to this project to get your GitHub profile included here.</sub>
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
29 changes: 29 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +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'

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,
},
},
]
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@

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()
Expand Down Expand Up @@ -486,7 +486,7 @@
this.proto_mismatch(next, connection, helo, 'esmtp')
}

exports.emit_log = function (next, connection, helo) {

Check warning on line 489 in index.js

View workflow job for this annotation

GitHub Actions / lint / lint

'helo' is defined but never used

Check warning on line 489 in index.js

View workflow job for this annotation

GitHub Actions / lint / lint

'helo' is defined but never used
// Spits out an INFO log entry. Default looks like this:
// [helo.checks] helo_host: [182.212.17.35], fail:big_co(rDNS) rdns_match(literal), pass:valid_hostname, match_re, bare_ip, literal_mismatch, mismatch, skip:dynamic(literal), valid_hostname(literal)
//
Expand Down
18 changes: 11 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand All @@ -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",
Expand All @@ -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
}
}
}
4 changes: 2 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down