TOPIC: Official Channel for the Haraka SMTP Server / npm install -g Haraka / http://haraka.github.io/ / current Haraka version: v2.8.6 / Chat Logs: https://botbot.me/freenode/haraka/
baudehlo
2.8.6 is out
dopesong_ has quit
dopesong joined the channel
bmonty has quit
dopesong has quit
darkpixel1
In the plugin docs (https://haraka.github.io/manual/Plugins.html) it says that the rcpt hook has the e-mail address in params[0]. The aliases plugin pushes aliases to connection.transaction.rcpt_to. This makes plugins like rcpt_to.ldap (which look at params[0]) look at the original RCPT TO address instead of the aliased address. Is this by design?
EyePulp has quit
dopesong joined the channel
dopesong has quit
DragonPunch joined the channel
SynchroM joined the channel
dopesong joined the channel
SynchroM has quit
SynchroM joined the channel
baudehlo
darkpixel1: I mean it's how the system works, but it might be the wrong thing to do.
EyePulp joined the channel
EyePulp_ joined the channel
EyePulp has quit
EyePulp_
2.8.6 !
EyePulp_ has quit
EyePulp joined the channel
dopesong_ joined the channel
baudehlo
EyePulp: yeah small bug fixes over 2.8.5
SIGINT wasn't working on single process mode for example.
EyePulp
Was that the one on node 4.x?
baudehlo
No, but I also fixed that.
dopesong has quit
Looks like the redis plugin shutdown code isn't right.
I don't use redis so I was just guessing.
EyePulp
does there need to be redis shutdown code? I think it's stateless.
baudehlo
There does with 2.8.5 onwards.
Because now we try and shutdown gracefully, making sure all network connections are finished with.
I think the code just needs to s/\.end/.quit/
darkpixel1
Just submitted a PR that should fix the issue between the aliases plugin and rcpt_to.ldap.
baudehlo
That sort of change should probably go in most rcpt hooks.
But I think the core team needs to discuss it a bit first.
not sure where _smf_ is these days.
or ultimatt.
darkpixel1
Created PR for redis shutdown
EyePulp
It's summer - everyone's on vacation maybe.
darkpixel1
baudehlo: Sounds good. I have a copy of rcpt_to.ldap called rcpt_to.exchange that really only changes the lookup field for users stored in Active Directory using the exchange proxyAddresses field. Eventually I'll try and merge it into the ldap plugin and add a parameter to the ini file for the lookup field name. That's how I ran in to it.
baudehlo
EyePulp: I know ultimatt is busy with his house. But i have _smf_ on my facebook and he's not on vacation.
darkpixel1: there's a typo in your PR.
+ this server.notes.redis.quit();
darkpixel1
Damn it.
Fixed
Do you have a recommendation on how I should be working on Haraka? I was live editing /usr/lib/node_modules/Haraka/plugins/redis.js. Once I had it fixed and tested, I edited ~/code/Haraka/plugins/redis.js and typo'd it. Is there a way to run Haraka directly out of ~/code/Haraka without having to npm install -g ~/code/Haraka/ every time I make change?
baudehlo
yeah you just run "node haraka"
Just don't commit your custom config/plugins and config/smtp.ini :)
(I've done that before)
darkpixel1: I assume that PR actually fixes the problem of not shutting down when running redis?
darkpixel1
Thanks baudehlo. That should help so I don't typo anything again.
Yeah--it fixed it for me. The shutdown is immediate, no delays.
baudehlo
cool, I'll merge it then.
Merged.
I knew there'd be a few problems like this with the graceful shutdown.
I'm still not happy about the single-process delay.
but not a lot I can do.
The with the single process setup is I'd want to wait and hope Node just exits - but then you can't do a setTimeout() to eventually force a quit, because Node will wait for the setTimeout to execute anyway :)
Ooh no I'm wrong. Node explicitly has timer.unref() to allow for that.
Sweeeeeeet.
I'll maybe look into cleaning the whole thing up a bit with unref() tonight, then I don't have to force process.exit() to run.
darkpixel1
Yeah, unref is handy. Whoever added that in needs a beer. ;)
baudehlo
Yup, that fixes everything (once I also unref the smtp and http servers).
nice.
Although 5s isn't long enough now.
Because you might have a pending outbound connection waiting to connect/finish.
I guess I'll just make it configurable, defaulting to 30s.
Why is it not recommended to run Haraka under PM2? It makes configuring a new VM ridiculously easy. npm install -g pm2; pm2 startup; pm2 completion install; pm2 start haraka -- -c /opt/mail (As opposed to fscking around with systemd) I've been testing it for about a month now under PM2 and it seems to behave perfectly.
baudehlo
darkpixel1: because pm2 tries to control pid files and daemonization and cluster mode and so on. All things Haraka itself needs to control.
I use runit, with a run file which literally just contains: