Closed dstibrany closed 7 years ago
Hi Dave, nice to hear from you!
(for other Haraka devs reading this - I used to work at the company using this, and wrote the original plugin here)
Knowing a bit about what goes on in hdmailer, it's related to handling attachments and pausing/resuming is my guess.
We wouldn't process the QUIT from the client if the connection was paused. At least I hope not - that code hasn't broken for my uses of it.
I thought I had put enough code into hdmailer to support this - I guess not.
You can see what is required by looking into the attachment plugin: https://github.com/haraka/Haraka/blob/master/plugins/attachment.js - look for where we call pause and resume. Check against those places in hdmailer and see if you're missing something. The basic principal is that you're calling resume() too soon. Add logging to the plugin to see if you're calling resume before the processing of attachments ends.
Alternatively just contact me personally (you have my email) and I'll take a poke at the code - it might be a straightforward fix.
As a side note, I'd love to improve all of this hackery. But it's a big back-burner ticket in Haraka. Unfortunately due to attachments using streams, we have yet to figure out a way to make this transparent to plugins. Maybe for 3.0.
On Fri, Apr 8, 2016 at 6:21 PM, Dave Stibrany notifications@github.com wrote:
Haraka version
2.7.2 Observed behaviour
I occasionally see clients send 'QUIT' commands before we send '250 Message Queued' replies. In those situations Haraka throws:
2016-04-08T13:54:53.00749 [ERROR] [EF24362D-72DC-4DBB-8B60-00DAD4A12BEF.1] [core] cmd_quit failed: Error: We are already running hooks! Fatal error! 2016-04-08T13:54:53.00778 [ERROR] [-] [core] undefinedError: We are already running hooks! Fatal error!0[ 'Error: We are already running hooks! Fatal error!', 2016-04-08T13:54:53.00779 ' at Object.plugins.run_hooks (/usr/local/lib/node_modules/Haraka/plugins.js:281:15)', 2016-04-08T13:54:53.00780 ' at Connection.cmd_quit (/usr/local/lib/node_modules/Haraka/connection.js:1193:13)', 2016-04-08T13:54:53.00781 ' at Connection.process_line (/usr/local/lib/node_modules/Haraka/connection.js:280:29)', 2016-04-08T13:54:53.00782 ' at Connection._process_data (/usr/local/lib/node_modules/Haraka/connection.js:423:18)', 2016-04-08T13:54:53.00783 ' at /usr/local/lib/node_modules/Haraka/connection.js:632:41', 2016-04-08T13:54:53.00783 ' at process._tickDomainCallback (node.js:486:13)' ] Expected behaviour
1) Any ideas why the client is behaving this way? 2) Any way to handle this more cleanly? In particular, I'd prefer to have the option to DENY these, because with 421 replies I keep getting this message sent (and the subsequent error) over and over. Steps to reproduce
Here is the last bit of data from the client before the error occurs:
... 2016-04-08T13:54:53.00168 [DATA] [EF24362D-72DC-4DBB-8B60-00DAD4A12BEF.1] [core] C: 0px; font-size: 0px; overflow: hidden; mso-hide: all"/>
\r 2016-04-08T13:54:53.00181 [DATA] [EF24362D-72DC-4DBB-8B60-00DAD4A12BEF.1] [core] C:
Haraka version
2.7.2
Observed behaviour
I occasionally see clients send 'QUIT' commands before we send '250 Message Queued' replies. In those situations Haraka throws:
2016-04-08T13:54:53.00749 [ERROR] [EF24362D-72DC-4DBB-8B60-00DAD4A12BEF.1] [core] cmd_quit failed: Error: We are already running hooks! Fatal error! 2016-04-08T13:54:53.00778 [ERROR] [-] [core] undefinedError: We are already running hooks! Fatal error!0[ 'Error: We are already running hooks! Fatal error!', 2016-04-08T13:54:53.00779 ' at Object.plugins.run_hooks (/usr/local/lib/node_modules/Haraka/plugins.js:281:15)', 2016-04-08T13:54:53.00780 ' at Connection.cmd_quit (/usr/local/lib/node_modules/Haraka/connection.js:1193:13)', 2016-04-08T13:54:53.00781 ' at Connection.process_line (/usr/local/lib/node_modules/Haraka/connection.js:280:29)', 2016-04-08T13:54:53.00782 ' at Connection._process_data (/usr/local/lib/node_modules/Haraka/connection.js:423:18)', 2016-04-08T13:54:53.00783 ' at /usr/local/lib/node_modules/Haraka/connection.js:632:41', 2016-04-08T13:54:53.00783 ' at process._tickDomainCallback (node.js:486:13)' ]
Expected behaviour
1) Any ideas why the client is behaving this way? 2) Any way to handle this more cleanly? In particular, I'd prefer to have the option to DENY these, because with 421 replies I keep getting this message sent (and the subsequent error) over and over.
Steps to reproduce
Here is the last bit of data from the client before the error occurs:
Thanks, let me know if there's any more info I can provide.
Dave