Closed tyranron closed 2 months ago
There are additional issues as well. For instance, in the hook_delivered params, the host is mistakenly set as the IP address. Additionally, the mailauth plugin's SPF check consistently fails.
Same here. If I manually copy docs/Plugin.md
to the current working directory it no longer bails that way.
But fails like this:
loaded TLD files:
1=1448
2=8320
3=3571
loaded 9672 Public Suffixes
loglevel: INFO
log format: DEFAULT
/opt/haraka/lib/node_modules/Haraka/bin/haraka:371
for (const hook of getHooks()) {
^
TypeError: getHooks is not a function or its return value is not iterable
at Object.<anonymous> (/opt/haraka/lib/node_modules/Haraka/bin/haraka:371:24)
at Module._compile (node:internal/modules/cjs/loader:1364:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
at Module.load (node:internal/modules/cjs/loader:1203:32)
at Module._load (node:internal/modules/cjs/loader:1019:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
at node:internal/main/run_main_module:28:49
I guess b/c the getHooks
function is missing an return
?
Plugins.md needs to be installed in the docs folder, e.g. /etc/haraka/docs/
Hey folks, @lnedry has a partial fix I merged in #3405 and this should be the other needful bit. Please confirm.
I confirmed that Plugins.md is being installed in the docs folder and help is working as expected.
@msimerson still not fixed for 3.0.5. Steps for reproducing are the same:
npm install -g Haraka@3.0.5
haraka -i /etc/haraka/
haraka -o -c /etc/haraka
@tyranron , please try this patch against the haraka 'binary' in your path. It should resolve the issue, and if not it'll at least provide a useful message.
diff --git a/bin/haraka b/bin/haraka
index 170bfbe7..0db61428 100755
--- a/bin/haraka
+++ b/bin/haraka
@@ -228,7 +228,8 @@ const plugin_doc = [
function getHooks () { // see haraka/Haraka#3306
- return fs.readFileSync('docs/Plugins.md').toString()
+ const pi_path = path.resolve(parsed.configs, 'docs', 'Plugins.md')
+ return fs.readFileSync(pi_path).toString()
.split('## Available Hooks')[1] // discard everything before this string
.split('### rcpt')[0] // discard everything after this string
.match(/\*\s(\S+)/gm) // grab the first word of lines starting with '* '
Reminder to self: paths should always be assembled using path.join
or path.resolve
, so that we don't needlessly harm Windows compatibility.
Additionally, the mailauth plugin's SPF check consistently fails.
@s-aga-r, Please create separate issues for stuff like this. Preferably in the repo where the issue is. postalsys/haraka-plugin-mailauth#3 should fix that.
I just installed in on a clean Debian 12 and it is working as expected.
# haraka -o -c /etc/haraka
loaded TLD files:
1=1445
2=8416
3=3642
loaded 9773 Public Suffixes
loglevel: INFO
log format: DEFAULT
Hook: mail ---------------------------------------------------------------------
Plugin Method Prio T/O
--------------------------------------------------------------------------------
mail_from.is_resolvable hook_mail 0 30
rcpt_to.in_host_list hook_mail 0 30
Hook: rcpt ---------------------------------------------------------------------
Plugin Method Prio T/O
--------------------------------------------------------------------------------
rcpt_to.in_host_list hook_rcpt 0 30
Hook: queue --------------------------------------------------------------------
Plugin Method Prio T/O
--------------------------------------------------------------------------------
queue/smtp_forward queue_forward 0 30
Hook: get_mx -------------------------------------------------------------------
Plugin Method Prio T/O
--------------------------------------------------------------------------------
queue/smtp_forward get_mx 0 30
I also confirmed that @msimerson's patch also works.
@msimerson I do confirm that the patch works.
Describe the bug
Expected behavior
Something like:
Observed behavior
Additional context
3.0.3 works OK.