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

Update helo.checks.js #3191

Merged
merged 3 commits into from
Jun 2, 2023
Merged

Update helo.checks.js #3191

merged 3 commits into from
Jun 2, 2023

Conversation

lnedry
Copy link
Contributor

@lnedry lnedry commented May 28, 2023

Resolved issue with literal_mismatch.

Resolved issue with literal_mismatch.
@msimerson
Copy link
Member

Can you define the issue and how this PR solves it? Thanks.

this.register_hook('helo', 'literal_mismatch');
this.register_hook('ehlo', 'literal_mismatch');

if (this.cfg.check.literal_mismatch === undefined) {
Copy link
Member

@msimerson msimerson May 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like a good place to use the nullish coalescing operator (??).

Suggested change
if (this.cfg.check.literal_mismatch === undefined) {
this.cfg.check.literal_mismatch === this.cfg.check.literal_mismatch ?? false;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've found more issues but I don't know how to cancel this pull request.
I create a new PR once I get these issues resolved.

Copy link
Member

@msimerson msimerson May 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just push additional commits to your branch lnedry:patch-4 and the PR will be updated automatically.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first issue that I fixed was the default value for this.cfg.check.literal_mismatch. It was set to true when it should have had a value of 2.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found more issues. None of the hooks were getting registered. There was a for...in loop which loops over the checks array. To get the correct values from the array, it should be a for...of loop.

Fixing this issue gets the hooks registered, but now each hook get called twice. So now the first time a hook gets called, I check for a previously added result.

lnedry and others added 2 commits May 29, 2023 10:45
I found more issues. None of the hooks were getting registered.  There was a for...in loop which loops over the checks array. To get the correct values from the array, it should be a for...of loop. 

Fixing this issue gets the hooks registered, but now each hook get called twice. So now the first time a hook gets called, I check for a previously added result.
@msimerson msimerson merged commit 9db0ac4 into haraka:master Jun 2, 2023
17 checks passed
msimerson added a commit to msimerson/Haraka that referenced this pull request Jun 2, 2023
This was referenced Jun 13, 2023
msimerson added a commit that referenced this pull request Jun 16, 2023
#### Fixed

- feat(q_forward): add LMTP routing handling #3199
- chore(q_forward): tighten up queue.wants handling #3199
- doc(q_forward): improve markdown formatting #3199
- helo.checks: several fixes, #3191
- q/smtp_forward: correct path to next_hop #3186
- don't leak addr parsing errors into SMTP conversation #3185
- connection: handle dns.reverse invalid throws on node v20 #3184
- rename redis command setex to setEx #3181

#### Changed

- test(helo.checks): add regression tests for #3191 #3195
- connection: handle dns.reverse invalid throws on node v20
- build(deps): bump ipaddr.js from 2.0.1 to 2.1.0 #3194
- chore: bump a few dependency versions #3184
- dns_list_base: avoid test failure when public DNS used #3184
- doc(outbound.ini) update link #3159
- doc(clamd.md) fixed spelling error #3155
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants