haraka / Haraka

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

OutboundTLS/plugin-redis missing logerror #3324

Closed analogic closed 7 months ago

analogic commented 7 months ago

As far as I understand, OutboundTLS is not a plugin, it doesn't have the logging capabilities that the Redis plugin depends on so it fails spectacularly in this edge case

2024-04-20 10:57:47.891120500  [DEBUG] [-] [OutboundTLS] Will disable outbound TLS for failing TLS hosts
2024-04-20 10:57:47.894424500  [DEBUG] [-] [outbound] todo header length: 914
2024-04-20 10:57:47.898506500  [CRIT] [-] [core] TypeError: this.logerror is not a function
2024-04-20 10:57:47.898511500  [CRIT] [-] [core]     at exports.get_redis_client (/usr/lib/node_modules/Haraka/node_modules/haraka-plugin-redis/index.js:194:14)
2024-04-20 10:57:47.898532500  [CRIT] [-] [core]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-04-20 10:57:47.898930500  [NOTICE] [-] [core] Shutting down
analogic commented 7 months ago

Hmm there is loginfo too right after connection. I think must have something terribly wrong with my stack, I am seeing errors on code which previously worked without major changes :)

ravivgolov commented 7 months ago

I am new, what is OutboundTLS?

msimerson commented 7 months ago

Restore line 20 (from my open PR) in that file and I think you'll find it better. Also, share a couple log entries, I think they'll be sub-par format, so I might add loggers to OBTLS differently.

msimerson commented 7 months ago

should be fixed in #3322

analogic commented 7 months ago

Thanks! logger.add_log_methods(this) work, PR will test later

2024-04-22 08:03:32.069514500 [INFO] [-] [core] connected to redis://127.0.0.1:6379

loginfo at https://github.com/haraka/haraka-plugin-redis/blob/ca6c766ea19339748b59991d89c882f5c7fe1b2d/index.js#L187 not available and therefore throwing exception catched later and printed with again not available logerror...