-
-
Notifications
You must be signed in to change notification settings - Fork 661
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
Update helo.checks.js #3191
Conversation
Resolved issue with literal_mismatch.
Can you define the issue and how this PR solves it? Thanks. |
plugins/helo.checks.js
Outdated
this.register_hook('helo', 'literal_mismatch'); | ||
this.register_hook('ehlo', 'literal_mismatch'); | ||
|
||
if (this.cfg.check.literal_mismatch === undefined) { |
There was a problem hiding this comment.
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 (??).
if (this.cfg.check.literal_mismatch === undefined) { | |
this.cfg.check.literal_mismatch === this.cfg.check.literal_mismatch ?? false; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.
#### 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
Resolved issue with literal_mismatch.