[core] TypeError: Cannot read properties of undefined (reading 'name')
analogic opened this issue · comments
analogic commented
[CRIT] [-] [core] TypeError: Cannot read properties of undefined (reading 'name')
[CRIT] [-] [core] at ResultStore._log (/usr/lib/node_modules/Haraka/node_modules/haraka-results/index.js:226:25)
[CRIT] [-] [core] at ResultStore.add (/usr/lib/node_modules/Haraka/node_modules/haraka-results/index.js:101:17)
[CRIT] [-] [core] at mxErr (/usr/lib/node_modules/Haraka/plugins/mail_from.is_resolvable.js:73:17)
[NOTICE] [-] [core] Shutting down
I came across this bug in a random test.
Haraka/plugins/mail_from.is_resolvable.js
Line 73 in f4cc2a6
It seems that this is used in the wrong context when catching an exception.
Matt Simerson commented
Indeed. Two ways to solve that:
1
- results.add(this, {err: `${domain}:${err.message}`});
+ results.add(plugin, {err: `${domain}:${err.message}`});
2
- function mxErr (err) {
+ const mxErr = (err) => {