haraka / Haraka

A fast, highly extensible, and event driven SMTP server
https://haraka.github.io
MIT License
5.08k stars 661 forks source link

Error in Greylist Plugin #3284

Closed simonjenny closed 6 months ago

simonjenny commented 8 months ago

The Greylist Plugin produces the following error:

2024-03-09T07:49:42.314Z [CRIT] [CA7A02D8-A423-476B-818D-28F822E3BC9C.1] [core] Plugin greylist failed: TypeError: this.db.hgetall is not a function

    at exports.db_lookup (/app/plugins/greylist.js:562:13)
    at exports.check_and_update_white (/app/plugins/greylist.js:259:17)
    at exports.hook_rcpt_ok (/app/plugins/greylist.js:162:10)
    at plugins.run_next_hook (/app/plugins.js:536:28)
    at callback (/app/plugins.js:489:32)
    at exports.apply_tarpit (/app/node_modules/haraka-plugin-karma/index.js:336:26)
    at exports.should_we_deny (/app/node_modules/haraka-plugin-karma/index.js:427:17)
    at exports.hook_rcpt_ok (/app/node_modules/haraka-plugin-karma/index.js:660:15)
    at plugins.run_next_hook (/app/plugins.js:536:28)
    at plugins.run_hooks (/app/plugins.js:445:13)

Env: Docker build from Haraka Version v3.0.3 based on node:lts-alpine

Config:

text = Greylisted. Please come back later.

[redis]
host = 10.0.0.5
port = 6379
db = 7

[skip]
dnswlorg = true
mailspikewl = true

[period]
# transition path: first_connect --> black (defer) --> grey(allow) --> white (allow) --> expired

# 14 minutes
black = 850
# 25 hours
grey = 90000
# 35 days
white = 3024000

[envelope_whitelist]
# Envelope emails or domains, one per line

[ip_whitelist]
# IP or Subnet, one per line

[recipient_whitelist]
# Recipient emails or domains, one per line

[special_dynamic_domains]
# Put domains that should be always treated as dynamic here.
# Pattern is matched at the end of rdns

# SiteGround VPS service
sgvps.net
msimerson commented 8 months ago

Oh, it probably didn't get updated to support Redis v4.

simonjenny commented 8 months ago

Unfortunately there has been another Error coming up in Greylisting:

2024-03-11T07:02:43.403Z [CRIT] [069FC011-B19E-41A9-801D-FFCF24912365.1] [core] Plugin greylist failed: TypeError: host.toLowerCase is not a function at exports.split_hostname (/app/node_modules/haraka-tld/index.js:108:22) at exports.craft_hostid (/app/plugins/greylist.js:420:28) at exports.craft_white_key (/app/plugins/greylist.js:367:26) at exports.check_and_update_white (/app/plugins/greylist.js:257:22) at exports.hook_rcpt_ok (/app/plugins/greylist.js:162:10) at plugins.run_next_hook (/app/plugins.js:536:28) at plugins.run_hooks (/app/plugins.js:445:13) at Connection.rcpt_respond (/app/connection.js:1157:25) at callback (/app/plugins.js:506:35) at /app/node_modules/haraka-plugin-wildduck/index.js:532:17

I can not determine if it is related to the Redis Bug, since it only happens with Greylisting but it appears to relate a function in another Module. If not maybe we can to split this into another issue