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

Fix undefined variable exception when no MX is found and add spf_record_include_match property #32

Merged
merged 5 commits into from
Nov 19, 2024

Conversation

smfreegard
Copy link
Contributor

Changes proposed in this pull request:

  • Fix crash in mech_mx code, caused by undefined variable if no valid MXs are found:
SPF error: domain sampark.gov.in Cannot read properties of undefined (reading 'join') TypeError: Cannot read properties of undefined (reading 'join')
    at SPF.mech_mx (/app/node_modules/haraka-plugin-spf/lib/spf.js:523:59)
    at async SPF.check_host (/app/node_modules/haraka-plugin-spf/lib/spf.js:307:22)
    at async cachedSPFLookup (/app/processors/dblack/index.js:26:27)
    at async Processor.process (/app/processors/dblack/index.js:122:20)
    at async /app/processors/lib/lib.js:813:11
    at async #process (/app/processors/lib/lib.js:808:12)
  • Add new spf_record_include_match property to allow for additional filtering

e.g. find includes that allow larges swathes of IPv4 space:

source_ip=95.79.45.75 domain="moduineffectua.com" spfRecord="v=spf1 include:_so.moduineffectua.com include:_vz.moduineffectua.com include:_v.moduineffectua.com ~all" match_include="v=spf1 ip4:0.0.0.0/5 ip4:8.0.0.0/7 ip4:11.0.0.0/8 ip4:12.0.0.0/6 ip4:16.0.0.0/4 ip4:32.0.0.0/3 ip4:64.0.0.0/2 ip4:128.0.0.0/3 ip4:160.0.0.0/5 ip4:168.0.0.0/6 ~all" include_domain="_so.moduineffectua.com"

Checklist:

  • docs updated
  • tests updated
  • Changes.md updated

@smfreegard smfreegard merged commit b290862 into haraka:master Nov 19, 2024
6 checks passed
@msimerson msimerson mentioned this pull request Nov 19, 2024
msimerson added a commit that referenced this pull request Nov 19, 2024
- Fix crash in mech_mx code, caused by undefined variable if no valid
MXs are found #32
- Add new `spf_record_include_match` property to allow for additional
filtering
- deps: bump versions to latest
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.

2 participants